kubeconform/main_test.go
2020-06-01 17:15:52 +02:00

41 lines
746 B
Go

package main
import (
"reflect"
"testing"
)
func TestSkipKindMaps(t *testing.T) {
for _, testCase := range []struct {
name string
csvSkipKinds string
expect map[string]bool
}{
{
"nothing to skip",
"",
map[string]bool{},
},
{
"a single kind to skip",
"somekind",
map[string]bool{
"somekind": true,
},
},
{
"multiple kinds to skip",
"somekind,anotherkind,yetsomeotherkind",
map[string]bool{
"somekind": true,
"anotherkind": true,
"yetsomeotherkind": true,
},
},
} {
got := skipKindsMap(testCase.csvSkipKinds)
if !reflect.DeepEqual(got, testCase.expect) {
t.Errorf("%s - got %+v, expected %+v", testCase.name, got, testCase.expect)
}
}
}