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

Function TestSetStringify

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

Source from the content-addressed store, hash-verified

133}
134
135func TestSetStringify(t *testing.T) {
136 t.Parallel()
137 x := NewSet[string]()
138 v := []string{"string1", "string2", "1234", "5678"}
139 x.AddRange(v)
140 z := x.Stringify()
141 // order is random
142 for _, i := range v {
143 if !strings.Contains(z, i) {
144 t.Fatalf("Did not find value %q in %q", i, z)
145 }
146 }
147
148 y := NewSet[int]()
149 v2 := []int{1, 2312, 123121, 999, -99}
150 y.AddRange(v2)
151 z = y.Stringify()
152 // order is random
153 for _, i := range v2 {
154 if !strings.Contains(z, strconv.Itoa(i)) {
155 t.Fatalf("Did not find value %q in %q", i, z)
156 }
157 }
158}
159
160func TestLineCounter(t *testing.T) {
161 t.Parallel()

Callers

nothing calls this directly

Calls 4

AddRangeMethod · 0.80
StringifyMethod · 0.80
ContainsMethod · 0.80
FatalfMethod · 0.80

Tested by

no test coverage detected