Skip to content

Commit 25c9403

Browse files
committed
fix: tests
1 parent c331e7e commit 25c9403

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

map_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func TestMap(t *testing.T) {
8989
return true
9090
})
9191

92-
require.Len(t, ranged, 0)
92+
require.Empty(t, ranged)
9393
})
9494

9595
t.Run("Swap", func(t *testing.T) {

pool_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package sync_test
22

33
import (
4+
"slices"
45
"testing"
6+
"time"
57

68
"github.com/oaiiae/sync-generic"
79
"github.com/stretchr/testify/require"
@@ -27,7 +29,7 @@ func TestPool(t *testing.T) {
2729
require.Equal(t, []byte(nil), p.Get())
2830
x := make([]byte, 8)
2931
p.Put(x)
30-
require.Equal(t, x, p.Get())
32+
require.Eventually(t, func() bool { return slices.Compare(p.Get(), x) == 0 }, 10*time.Second, time.Second/10)
3133
require.Equal(t, []byte(nil), p.Get())
3234
})
3335
}

0 commit comments

Comments
 (0)