add empty match tests

This commit is contained in:
Gokcehan 2016-09-12 23:40:17 +03:00
parent a2c7656301
commit 9c2f594a6b

View File

@ -34,6 +34,8 @@ func TestMatchWord(t *testing.T) {
matches []string
longest string
}{
{"", nil, nil, ""},
{"", []string{"foo", "bar", "baz"}, []string{"foo", "bar", "baz"}, ""},
{"fo", []string{"foo", "bar", "baz"}, []string{"foo"}, "foo "},
{"ba", []string{"foo", "bar", "baz"}, []string{"bar", "baz"}, "ba"},
{"fo", []string{"bar", "baz"}, nil, "fo"},