Skip to content
This repository has been archived by the owner on Sep 25, 2019. It is now read-only.

Commit

Permalink
Add more nested globpath tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sparrc authored and mlinde201 committed Feb 6, 2017
1 parent ef56e20 commit 2b4d32a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/globpath/globpath_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestCompileAndMatch(t *testing.T) {
require.NoError(t, err)

matches := g1.Match()
assert.Len(t, matches, 3)
assert.Len(t, matches, 6)
matches = g2.Match()
assert.Len(t, matches, 2)
matches = g3.Match()
Expand Down Expand Up @@ -56,6 +56,16 @@ func TestFindRootDir(t *testing.T) {
}
}

func TestFindNestedTextFile(t *testing.T) {
dir := getTestdataDir()
// test super asterisk
g1, err := Compile(dir + "/**.txt")
require.NoError(t, err)

matches := g1.Match()
assert.Len(t, matches, 1)
}

func getTestdataDir() string {
_, filename, _, _ := runtime.Caller(1)
return strings.Replace(filename, "globpath_test.go", "testdata", 1)
Expand Down
Empty file.

0 comments on commit 2b4d32a

Please sign in to comment.