MCPcopy Index your code
hub / github.com/FairwindsOps/pluto / Test_StringInSlice

Function Test_StringInSlice

pkg/api/helpers_test.go:23–57  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21)
22
23func Test_StringInSlice(t *testing.T) {
24 type args struct {
25 a string
26 list []string
27 }
28 tests := []struct {
29 name string
30 args args
31 want bool
32 }{
33 {
34 name: "test true",
35 args: args{
36 a: "string",
37 list: []string{"test", "string"},
38 },
39 want: true,
40 },
41 {
42 name: "test false",
43 args: args{
44 a: "string",
45 list: []string{"test", "nothere"},
46 },
47 want: false,
48 },
49 }
50 for _, tt := range tests {
51 t.Run(tt.name, func(t *testing.T) {
52 if got := StringInSlice(tt.args.a, tt.args.list); got != tt.want {
53 assert.EqualValues(t, tt.want, got)
54 }
55 })
56 }
57}
58
59func TestIsFileOrStdin(t *testing.T) {
60 tests := []struct {

Callers

nothing calls this directly

Calls 1

StringInSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…