MCPcopy
hub / github.com/cortexlabs/cortex / TestNew

Function TestNew

pkg/lib/sets/strset/strset_test.go:29–41  ·  view source on GitHub ↗

Also tests Add

(t *testing.T)

Source from the content-addressed store, hash-verified

27
28// Also tests Add
29func TestNew(t *testing.T) {
30 set := strset.New()
31 require.Equal(t, 0, len(set))
32
33 set = strset.New("a", "b", "a")
34 require.Equal(t, 2, len(set))
35 if _, ok := set["a"]; !ok {
36 require.FailNow(t, "a not found in set")
37 }
38 if _, ok := set["b"]; !ok {
39 require.FailNow(t, "b not found in set")
40 }
41}
42
43func TestAdd(t *testing.T) {
44 set := strset.New()

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
EqualMethod · 0.80

Tested by

no test coverage detected