(t *testing.T)
| 25 | } |
| 26 | |
| 27 | func TestGetLocalOptWords(t *testing.T) { |
| 28 | tests := []struct { |
| 29 | localOpts any |
| 30 | exp []string |
| 31 | }{ |
| 32 | {struct{ feature map[string]bool }{}, []string{"feature", "feature!", "nofeature"}}, |
| 33 | {struct{ feature map[string]int }{}, []string{"feature"}}, |
| 34 | {struct{ feature map[string]string }{}, []string{"feature"}}, |
| 35 | {struct{ feature map[string][]string }{}, []string{"feature"}}, |
| 36 | } |
| 37 | |
| 38 | for _, test := range tests { |
| 39 | result := getLocalOptWords(test.localOpts) |
| 40 | if !reflect.DeepEqual(result, test.exp) { |
| 41 | t.Errorf("at input '%#v' expected '%s' but got '%s'", test.localOpts, test.exp, result) |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | func TestGetLongest(t *testing.T) { |
| 47 | tests := []struct { |
nothing calls this directly
no test coverage detected