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

Function TestSetContainsAny

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

Source from the content-addressed store, hash-verified

106}
107
108func TestSetContainsAny(t *testing.T) {
109 t.Parallel()
110 x := NewSet[string]()
111 v := []string{"string1", "string2", "1234", "5678"}
112 x.AddRange(v)
113 if !x.ContainsAny(v) {
114 t.Fatalf("Did not find any")
115 }
116
117 // test not found
118 if x.ContainsAny([]string{"mmmm", "nnnnn"}) {
119 t.Fatal("Found unexpected values")
120 }
121
122 y := NewSet[int]()
123 v2 := []int{1, 2312, 123121, 999, -99}
124 y.AddRange(v2)
125 if !y.ContainsAny(v2) {
126 t.Fatalf("Did not find any")
127 }
128
129 // test not found
130 if y.ContainsAny([]int{9235, 2398532}) {
131 t.Fatal("Found unexpected values")
132 }
133}
134
135func TestSetStringify(t *testing.T) {
136 t.Parallel()

Callers

nothing calls this directly

Calls 4

AddRangeMethod · 0.80
ContainsAnyMethod · 0.80
FatalfMethod · 0.80
FatalMethod · 0.80

Tested by

no test coverage detected