diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2022-09-05 12:43:46 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2022-09-05 12:43:46 -0600 |
commit | 7fba10e5be51a3fe565a6f69a946ece9f0e59a67 (patch) | |
tree | 91bc89b8d1e5dba3ead0319daeef3181ccc6da4d /lib/containers/rbtree_test.go | |
parent | abdc8394bcb7080f01859cbfe367beecf5aef06f (diff) |
Try to uniformly use containers.Set
Diffstat (limited to 'lib/containers/rbtree_test.go')
-rw-r--r-- | lib/containers/rbtree_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/containers/rbtree_test.go b/lib/containers/rbtree_test.go index 65cc78d..9841d26 100644 --- a/lib/containers/rbtree_test.go +++ b/lib/containers/rbtree_test.go @@ -49,7 +49,7 @@ func (node *RBNode[V]) asciiArt(w io.Writer, u, m, l string) { node.Left.asciiArt(w, l+" | ", l+" `--", l+" ") } -func checkRBTree[K constraints.Ordered, V any](t *testing.T, expectedSet map[K]struct{}, tree *RBTree[NativeOrdered[K], V]) { +func checkRBTree[K constraints.Ordered, V any](t *testing.T, expectedSet Set[K], tree *RBTree[NativeOrdered[K], V]) { // 1. Every node is either red or black // 2. The root is black. @@ -142,7 +142,7 @@ func FuzzRBTree(f *testing.F) { return NativeOrdered[uint8]{Val: x} }, } - set := make(map[uint8]struct{}) + set := make(Set[uint8]) checkRBTree(t, set, tree) t.Logf("\n%s\n", tree.ASCIIArt()) for _, b := range dat { @@ -151,7 +151,7 @@ func FuzzRBTree(f *testing.F) { if ins { t.Logf("Insert(%v)", val) tree.Insert(val) - set[val] = struct{}{} + set.Insert(val) t.Logf("\n%s\n", tree.ASCIIArt()) node := tree.Lookup(NativeOrdered[uint8]{Val: val}) require.NotNil(t, node) |