package dbstore import "testing" func TestCpeSearchTypeString(t *testing.T) { tests := []struct { val CpeSearchType exp string } { { CpeSearchAll, "cpe/search-all" }, { CpeSearchTitle, "cpe/search-title" }, { CpeSearchRef, "cpe/search-ref" }, { CpeSearchType(255), "CpeSearchType(255)" }, } for _, test := range(tests) { t.Run(test.exp, func(t *testing.T) { got := test.val.String() if got != test.exp { t.Errorf("got \"%s\", exp \"%s\"", got, test.exp) } }) } }