2
0

[pool] Replace queue with stack

This commit is contained in:
Jan Dubsky
2022-10-10 18:15:52 +02:00
committed by Jack Christensen
parent 30b91519a0
commit 89668fae42
6 changed files with 194 additions and 335 deletions
+21
View File
@@ -0,0 +1,21 @@
package puddle
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestResList_PanicsWithBugReportIfResourceDoesNotExist(t *testing.T) {
arr := []*Resource[any]{
new(Resource[any]),
new(Resource[any]),
new(Resource[any]),
}
list := resList[any](arr)
assert.PanicsWithValue(t, "BUG: removeResource could not find res in slice", func() {
list.remove(new(Resource[any]))
})
}