fix: tests were out of date
All checks were successful
CI / Check PR Title (pull_request) Successful in 32s
CI / Go Lint (pull_request) Successful in 54s
CI / Markdown Lint (pull_request) Successful in 34s
CI / Makefile Lint (pull_request) Successful in 54s
CI / Unit Tests (pull_request) Successful in 54s
CI / Fuzz Tests (pull_request) Successful in 1m25s
CI / Mutation Tests (pull_request) Successful in 1m8s

This commit is contained in:
2026-04-16 21:12:39 -04:00
parent 24df23218c
commit b395d6e1f4
4 changed files with 18 additions and 18 deletions

View File

@@ -25,7 +25,7 @@ func TestAddItem(t *testing.T) {
key, value := 0, true
table := cuckoo.New[int, bool]()
_, err := table.Put(key, value)
err := table.Put(key, value)
assert.NoError(err)
assert.Equal(1, table.Size())
@@ -38,7 +38,7 @@ func TestPutOverwrite(t *testing.T) {
table := cuckoo.New[int, int]()
(table.Put(key, value))
_, err := table.Put(key, newValue)
err := table.Put(key, newValue)
assert.NoError(err)
assert.Equal(1, table.Size())
@@ -52,9 +52,9 @@ func TestSameHash(t *testing.T) {
hash := func(int) uint64 { return 0 }
table := cuckoo.NewCustom[int, bool](hash, hash, cuckoo.DefaultEqualFunc[int])
_, errA := table.Put(0, true)
_, errB := table.Put(1, true)
_, errC := table.Put(2, true)
errA := table.Put(0, true)
errB := table.Put(1, true)
errC := table.Put(2, true)
assert.NoError(errA)
assert.NoError(errB)
@@ -76,7 +76,7 @@ func TestResizeCapacity(t *testing.T) {
)
for table.TotalCapacity() == 16 {
_, err := table.Put(rand.Int(), true)
err := table.Put(rand.Int(), true)
assert.NoError(err)
}
@@ -89,7 +89,7 @@ func TestPutMany(t *testing.T) {
for i := range 1_000 {
expected[i] = true
_, err := actual.Put(i, true)
err := actual.Put(i, true)
assert.NoError(err)
}
@@ -103,7 +103,7 @@ func TestGetMany(t *testing.T) {
table := cuckoo.New[int, bool]()
for i := range 1_000 {
_, err := table.Put(i, true)
err := table.Put(i, true)
assert.NoError(err)
}
@@ -167,7 +167,7 @@ func TestPutNoCapacity(t *testing.T) {
cuckoo.Capacity(0),
)
_, err := table.Put(key, value)
err := table.Put(key, value)
assert.NoError(err)
assert.Equal(1, table.Size())
@@ -183,9 +183,9 @@ func TestBadHashCapacity(t *testing.T) {
cuckoo.Capacity(20),
)
_, err1 := table.Put(0, true)
_, err2 := table.Put(1, true)
_, err3 := table.Put(2, true)
err1 := table.Put(0, true)
err2 := table.Put(1, true)
err3 := table.Put(2, true)
assert.NoError(err1)
assert.NoError(err2)
@@ -200,8 +200,8 @@ func TestDropResizeCapacity(t *testing.T) {
cuckoo.Capacity(10),
)
_, err1 := table.Put(0, true)
_, err2 := table.Put(1, true)
err1 := table.Put(0, true)
err2 := table.Put(1, true)
table.Drop(1)
assert.NoError(errors.Join(err1, err2))
@@ -218,7 +218,7 @@ func TestNewTableBy(t *testing.T) {
assert := assert.New(t)
table := cuckoo.NewBy[User, bool](func(u User) string { return u.id })
_, err := table.Put(User{nil, "1", "Robert"}, true)
err := table.Put(User{nil, "1", "Robert"}, true)
assert.NoError(err)
assert.Equal(1, table.Size())