From d581ef2678ec726753689bee4c2d8ff4a5d090ad Mon Sep 17 00:00:00 2001 From: Bob Matcuk Date: Sat, 9 Jul 2022 18:45:30 -0400 Subject: [PATCH] fix windows tests --- doublestar_test.go | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/doublestar_test.go b/doublestar_test.go index b9287ff..ab2db3d 100644 --- a/doublestar_test.go +++ b/doublestar_test.go @@ -33,7 +33,7 @@ var matchTests = []MatchTest{ {"/*", "/debug/", false, nil, true, false, 0, 0}, {"/*", "//", false, nil, true, false, 0, 0}, {"abc", "abc", true, nil, true, true, 1, 1}, - {"*", "abc", true, nil, true, true, 20, 15}, + {"*", "abc", true, nil, true, true, 20, 16}, {"*c", "abc", true, nil, true, true, 2, 2}, {"*/", "a/", true, nil, true, false, 0, 0}, {"a*", "a", true, nil, true, true, 9, 9}, @@ -60,8 +60,8 @@ var matchTests = []MatchTest{ {"a[!a]b", "a☺b", true, nil, false, true, 1, 1}, {"a???b", "a☺b", false, nil, true, true, 0, 0}, {"a[^a][^a][^a]b", "a☺b", false, nil, true, true, 0, 0}, - {"[a-ζ]*", "α", true, nil, true, true, 18, 15}, - {"*[a-ζ]", "A", false, nil, true, true, 18, 15}, + {"[a-ζ]*", "α", true, nil, true, true, 18, 16}, + {"*[a-ζ]", "A", false, nil, true, true, 18, 16}, {"a?b", "a/b", false, nil, true, true, 1, 1}, {"a*b", "a/b", false, nil, true, true, 1, 1}, {"[\\]a]", "]", true, nil, true, !onWindows, 2, 2}, @@ -143,22 +143,22 @@ var matchTests = []MatchTest{ {"working-symlink/c/*", "working-symlink/c/d", true, nil, true, !onWindows, 1, 1}, {"working-sym*/*", "working-symlink/c", true, nil, true, !onWindows, 1, 1}, {"b/**/f", "b/symlink-dir/f", true, nil, false, !onWindows, 2, 2}, - {"e/**", "e/**", true, nil, false, true, 11, 11}, - {"e/**", "e/*", true, nil, false, true, 11, 11}, - {"e/**", "e/?", true, nil, false, true, 11, 11}, - {"e/**", "e/[", true, nil, false, true, 11, 11}, - {"e/**", "e/]", true, nil, false, true, 11, 11}, - {"e/**", "e/[]", true, nil, false, true, 11, 11}, - {"e/**", "e/{", true, nil, false, true, 11, 11}, - {"e/**", "e/}", true, nil, false, true, 11, 11}, - {"e/**", "e/\\", true, nil, false, true, 11, 11}, - {"e/*", "e/*", true, nil, true, true, 10, 10}, - {"e/?", "e/?", true, nil, true, true, 7, 7}, - {"e/?", "e/*", true, nil, true, true, 7, 7}, - {"e/?", "e/[", true, nil, true, true, 7, 7}, - {"e/?", "e/]", true, nil, true, true, 7, 7}, - {"e/?", "e/{", true, nil, true, true, 7, 7}, - {"e/?", "e/}", true, nil, true, true, 7, 7}, + {"e/**", "e/**", true, nil, false, !onWindows, 11, 6}, + {"e/**", "e/*", true, nil, false, !onWindows, 11, 6}, + {"e/**", "e/?", true, nil, false, !onWindows, 11, 6}, + {"e/**", "e/[", true, nil, false, true, 11, 6}, + {"e/**", "e/]", true, nil, false, true, 11, 6}, + {"e/**", "e/[]", true, nil, false, true, 11, 6}, + {"e/**", "e/{", true, nil, false, true, 11, 6}, + {"e/**", "e/}", true, nil, false, true, 11, 6}, + {"e/**", "e/\\", true, nil, false, !onWindows, 11, 6}, + {"e/*", "e/*", true, nil, true, !onWindows, 10, 5}, + {"e/?", "e/?", true, nil, true, !onWindows, 7, 4}, + {"e/?", "e/*", true, nil, true, !onWindows, 7, 4}, + {"e/?", "e/[", true, nil, true, true, 7, 4}, + {"e/?", "e/]", true, nil, true, true, 7, 4}, + {"e/?", "e/{", true, nil, true, true, 7, 4}, + {"e/?", "e/}", true, nil, true, true, 7, 4}, {"e/\\[", "e/[", true, nil, true, !onWindows, 1, 1}, {"e/[", "e/[", false, ErrBadPattern, true, true, 0, 0}, {"e/]", "e/]", true, nil, true, true, 1, 1}, @@ -437,7 +437,7 @@ func verifyGlobResults(t *testing.T, idx int, fn string, tt MatchTest, fsys fs.F numResults = tt.winNumResults } if len(matches) != numResults { - t.Errorf("#%v. %v(%#q) = %#v - should have %#v results, got %#v", idx, fn, tt.pattern, matches, tt.numResults, len(matches)) + t.Errorf("#%v. %v(%#q) = %#v - should have %#v results, got %#v", idx, fn, tt.pattern, matches, numResults, len(matches)) } if inSlice(tt.testPath, matches) != tt.shouldMatch { if tt.shouldMatch {