diff options
| author | Eyal Posener <[email protected]> | 2017-05-11 00:38:24 +0300 |
|---|---|---|
| committer | Eyal Posener <[email protected]> | 2017-05-11 02:16:39 +0300 |
| commit | 72dfe017e9209c1809cfcfcbd9039551fe4d2103 (patch) | |
| tree | 4881f90157f3605fbb488c32e0faae7dff1bc818 /complete_test.go | |
| parent | 1c743d8c0b8235ea2dbf0856987f8bd5b77a0042 (diff) | |
Improve files and directories completion
Diffstat (limited to 'complete_test.go')
| -rw-r--r-- | complete_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/complete_test.go b/complete_test.go index 147a361..282a2f6 100644 --- a/complete_test.go +++ b/complete_test.go @@ -23,7 +23,7 @@ func TestCompleter_Complete(t *testing.T) { "-flag2": PredictNothing, "-flag3": PredictSet("opt1", "opt2", "opt12"), }, - Args: Predicate(PredictDirs).Or(PredictFiles("*.md")), + Args: Predicate(PredictDirs("*")).Or(PredictFiles("*.md")), }, }, Flags: map[string]Predicate{ @@ -41,7 +41,7 @@ func TestCompleter_Complete(t *testing.T) { allGlobals = append(allGlobals, flag) } - testTXTFiles := []string{"./a.txt", "./b.txt", "./c.txt"} + testTXTFiles := []string{"./a.txt", "./b.txt", "./c.txt", "./.dot.txt"} tests := []struct { args string @@ -81,11 +81,11 @@ func TestCompleter_Complete(t *testing.T) { }, { args: "sub2 ", - want: []string{"./", "./dir", "./readme.md", "-flag2", "-flag3", "-h", "-global1", "-o"}, + want: []string{"./", "./dir/", "./readme.md", "-flag2", "-flag3", "-h", "-global1", "-o"}, }, { args: "sub2 ./", - want: []string{"./", "./readme.md", "./dir"}, + want: []string{"./", "./readme.md", "./dir/"}, }, { args: "sub2 re", @@ -93,7 +93,7 @@ func TestCompleter_Complete(t *testing.T) { }, { args: "sub2 -flag2 ", - want: []string{"./", "./dir", "./readme.md", "-flag2", "-flag3", "-h", "-global1", "-o"}, + want: []string{"./", "./dir/", "./readme.md", "-flag2", "-flag3", "-h", "-global1", "-o"}, }, { args: "sub1 -fl", |
