MCPcopy Create free account
hub / github.com/gokcehan/lf / TestGetLocalOptWords

Function TestGetLocalOptWords

complete_test.go:27–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func 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
46func TestGetLongest(t *testing.T) {
47 tests := []struct {

Callers

nothing calls this directly

Calls 1

getLocalOptWordsFunction · 0.85

Tested by

no test coverage detected