MCPcopy
hub / github.com/OJ/gobuster / TestSetContains

Function TestSetContains

libgobuster/helpers_test.go:87–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

85}
86
87func TestSetContains(t *testing.T) {
88 t.Parallel()
89 x := NewSet[string]()
90 v := []string{"string1", "string2", "1234", "5678"}
91 x.AddRange(v)
92 for _, i := range v {
93 if !x.Contains(i) {
94 t.Fatalf("Did not find value %s in array. %v", i, x.Set)
95 }
96 }
97
98 y := NewSet[int]()
99 v2 := []int{1, 2312, 123121, 999, -99}
100 y.AddRange(v2)
101 for _, i := range v2 {
102 if !y.Contains(i) {
103 t.Fatalf("Did not find value %d in array. %v", i, y.Set)
104 }
105 }
106}
107
108func TestSetContainsAny(t *testing.T) {
109 t.Parallel()

Callers

nothing calls this directly

Calls 3

AddRangeMethod · 0.80
ContainsMethod · 0.80
FatalfMethod · 0.80

Tested by

no test coverage detected