mirror of
https://github.com/yannh/kubeconform.git
synced 2026-02-11 14:09:21 +00:00
41 lines
746 B
Go
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)
|
|
}
|
|
}
|
|
}
|