Skip to content

Commit

Permalink
fix windows tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatcuk committed Jul 9, 2022
1 parent 5ac5316 commit d581ef2
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions doublestar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand All @@ -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},
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit d581ef2

Please sign in to comment.