diff options
| author | Eyal Posener <[email protected]> | 2017-11-04 11:57:02 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-11-04 11:57:02 +0200 |
| commit | dc2bc5a81accba8782bebea28628224643a8286a (patch) | |
| tree | 0f7976f712f3cb3c70eac8eb78b5027e445e16c8 /complete_test.go | |
| parent | 00c86494ff7035cfd62f66042e9ca2b118b90122 (diff) | |
| parent | a1f9ea005b8360153429321071da4e42ce6ce323 (diff) | |
Merge pull request #54 from posener/split-last-equal
Add logic to complete when last flag uses the equal sign
Diffstat (limited to 'complete_test.go')
| -rw-r--r-- | complete_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/complete_test.go b/complete_test.go index 19bc688..1611ad4 100644 --- a/complete_test.go +++ b/complete_test.go @@ -147,14 +147,30 @@ func TestCompleter_Complete(t *testing.T) { want: []string{"./a.txt", "./b.txt", "./c.txt", "./.dot.txt", "./", "./dir/", "./outer/"}, }, { + args: "-o=./", + want: []string{"./a.txt", "./b.txt", "./c.txt", "./.dot.txt", "./", "./dir/", "./outer/"}, + }, + { args: "-o .", want: []string{"./a.txt", "./b.txt", "./c.txt", "./.dot.txt", "./", "./dir/", "./outer/"}, }, { + args: "-o ./b", + want: []string{"./b.txt"}, + }, + { + args: "-o=./b", + want: []string{"./b.txt"}, + }, + { args: "-o ./read", want: []string{}, }, { + args: "-o=./read", + want: []string{}, + }, + { args: "-o ./readme.md", want: []string{}, }, @@ -163,6 +179,10 @@ func TestCompleter_Complete(t *testing.T) { want: []string{"sub1", "sub2"}, }, { + args: "-o=./readme.md ", + want: []string{"sub1", "sub2"}, + }, + { args: "-o sub2 -flag3 ", want: []string{"opt1", "opt2", "opt12"}, }, |
