summaryrefslogtreecommitdiff
path: root/predict_test.go
diff options
context:
space:
mode:
authorEyal Posener <[email protected]>2017-05-13 00:40:26 +0300
committerEyal Posener <[email protected]>2017-05-13 00:40:26 +0300
commitbc5d682221f38e82bbd977d5567da8b884a30cbc (patch)
tree33e21d60ec1412ff7aaf1c73363208e79d96d8b3 /predict_test.go
parentf580110640e0213502e4fe1138a06f57b532ff7a (diff)
fix nested files
Diffstat (limited to 'predict_test.go')
-rw-r--r--predict_test.go18
1 files changed, 15 insertions, 3 deletions
diff --git a/predict_test.go b/predict_test.go
index 9fe22a9..b2840c0 100644
--- a/predict_test.go
+++ b/predict_test.go
@@ -60,7 +60,7 @@ func TestPredicate(t *testing.T) {
{
name: "files/txt",
p: PredictFiles("*.txt"),
- want: []string{"./", "./dir/", "./a.txt", "./b.txt", "./c.txt", "./.dot.txt"},
+ want: []string{"./", "./dir/", "./outer/", "./a.txt", "./b.txt", "./c.txt", "./.dot.txt"},
},
{
name: "files/txt",
@@ -84,7 +84,7 @@ func TestPredicate(t *testing.T) {
name: "files/md",
p: PredictFiles("*.md"),
argList: []string{"", ".", "./"},
- want: []string{"./", "./dir/", "./readme.md"},
+ want: []string{"./", "./dir/", "./outer/", "./readme.md"},
},
{
name: "dirs",
@@ -102,7 +102,19 @@ func TestPredicate(t *testing.T) {
name: "root directories",
p: PredictDirs("*"),
argList: []string{"", ".", "./"},
- want: []string{"./", "./dir/"},
+ want: []string{"./", "./dir/", "./outer/"},
+ },
+ {
+ name: "nested directories",
+ p: PredictDirs("*.md"),
+ argList: []string{"ou", "./ou", "./outer", "./outer/"},
+ want: []string{"./outer/", "./outer/inner/"},
+ },
+ {
+ name: "nested inner directory",
+ p: PredictFiles("*.md"),
+ argList: []string{"outer/i"},
+ want: []string{"./outer/inner/", "./outer/inner/readme.md"},
},
}