MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestNewFixedSet

Function TestNewFixedSet

internal/utils/sets/set_fixed_test.go:12–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestNewFixedSet(t *testing.T) {
13 var a = assert.NewAssertion(t)
14
15 {
16 var set = setutils.NewFixedSet(0)
17 set.Push(1)
18 set.Push(2)
19 set.Push(2)
20 a.IsTrue(set.Size() == 2)
21 a.IsTrue(set.Has(1))
22 a.IsTrue(set.Has(2))
23 }
24
25 {
26 var set = setutils.NewFixedSet(1)
27 set.Push(1)
28 set.Push(2)
29 set.Push(3)
30 a.IsTrue(set.Size() == 1)
31 a.IsFalse(set.Has(1))
32 a.IsTrue(set.Has(3))
33 a.IsFalse(set.Has(4))
34 }
35}
36
37func TestFixedSet_Reset(t *testing.T) {
38 var a = assert.NewAssertion(t)

Callers

nothing calls this directly

Calls 3

PushMethod · 0.45
SizeMethod · 0.45
HasMethod · 0.45

Tested by

no test coverage detected