diff --git a/internal/globpath/globpath_test.go b/internal/globpath/globpath_test.go index db72c94f4..720572411 100644 --- a/internal/globpath/globpath_test.go +++ b/internal/globpath/globpath_test.go @@ -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() @@ -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) diff --git a/internal/globpath/testdata/nested1/nested2/nested.txt b/internal/globpath/testdata/nested1/nested2/nested.txt new file mode 100644 index 000000000..e69de29bb