diff options
| author | Eyal Posener <[email protected]> | 2017-05-11 21:57:44 +0300 |
|---|---|---|
| committer | Eyal Posener <[email protected]> | 2017-05-11 21:57:44 +0300 |
| commit | d6cbc0e9690035368477b3ed8aa22aece0381b77 (patch) | |
| tree | 44d4e90b2b54a50e2f468f195410419e497daa66 /predict_test.go | |
| parent | 7b1b902128e784fdf6ddeeb2347417f091fc8dc5 (diff) | |
predict: when searching for files, show also directories
Diffstat (limited to 'predict_test.go')
| -rw-r--r-- | predict_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/predict_test.go b/predict_test.go index 6b77fbe..ebe8aa1 100644 --- a/predict_test.go +++ b/predict_test.go @@ -60,30 +60,30 @@ func TestPredicate(t *testing.T) { { name: "files/txt", p: PredictFiles("*.txt"), - want: []string{"./a.txt", "./b.txt", "./c.txt", "./.dot.txt"}, + want: []string{"./", "./dir/", "./a.txt", "./b.txt", "./c.txt", "./.dot.txt"}, }, { name: "files/txt", p: PredictFiles("*.txt"), arg: "./dir/", - want: []string{}, + want: []string{"./dir/"}, }, { name: "files/x", p: PredictFiles("x"), arg: "./dir/", - want: []string{"./dir/x"}, + want: []string{"./dir/", "./dir/x"}, }, { name: "files/*", p: PredictFiles("x*"), arg: "./dir/", - want: []string{"./dir/x"}, + want: []string{"./dir/", "./dir/x"}, }, { name: "files/md", p: PredictFiles("*.md"), - want: []string{"./readme.md"}, + want: []string{"./", "./dir/", "./readme.md"}, }, { name: "dirs", @@ -93,7 +93,7 @@ func TestPredicate(t *testing.T) { }, { name: "dirs and files", - p: PredictFilesOrDirs("*"), + p: PredictFiles("*"), arg: "./dir", want: []string{"./dir/", "./dir/x"}, }, @@ -106,7 +106,7 @@ func TestPredicate(t *testing.T) { name: "subdir", p: PredictFiles("*"), arg: "./dir/", - want: []string{"./dir/x"}, + want: []string{"./dir/", "./dir/x"}, }, } |
