MCPcopy Create free account
hub / github.com/containerd/nerdctl / TestInStringSlice

Function TestInStringSlice

pkg/strutil/strutil_test.go:194–228  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

192}
193
194func TestInStringSlice(t *testing.T) {
195 type args struct {
196 ss []string
197 str string
198 }
199 tests := []struct {
200 name string
201 args args
202 want bool
203 }{
204 {
205 name: "normal",
206 args: args{
207 ss: []string{"foo", "bar", "baz"},
208 str: "bar",
209 },
210 want: true,
211 },
212 {
213 name: "normal-1",
214 args: args{
215 ss: []string{"foo", "bar", "baz"},
216 str: "qux",
217 },
218 want: false,
219 },
220 }
221 for _, tt := range tests {
222 t.Run(tt.name, func(t *testing.T) {
223 if got := InStringSlice(tt.args.ss, tt.args.str); got != tt.want {
224 t.Errorf("InStringSlice() = %v, want %v", got, tt.want)
225 }
226 })
227 }
228}
229
230func TestParseCSVMap(t *testing.T) {
231 type args struct {

Callers

nothing calls this directly

Calls 2

InStringSliceFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…