Skip to content

Commit

Permalink
Add standard tests to compiled pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemassa committed Jan 25, 2025
1 parent 3cf2709 commit 15cbf42
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doublestar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ func testCompileWith(t *testing.T, idx int, tt MatchTest) {
if ok != tt.shouldMatch || err != tt.expectedErr {
t.Errorf("#%v. Match(%#q, %#q) = %v, %v want %v, %v", idx, tt.pattern, tt.testPath, ok, err, tt.shouldMatch, tt.expectedErr)
}

if tt.isStandard {
stdOk, stdErr := path.Match(tt.pattern, tt.testPath)
if ok != stdOk || !compareErrors(err, stdErr) {
t.Errorf("#%v. Match(%#q, %#q) != path.Match(...). Got %v, %v want %v, %v", idx, tt.pattern, tt.testPath, ok, err, stdOk, stdErr)
}
}
}

func testMatchWith(t *testing.T, idx int, tt MatchTest) {
Expand Down

0 comments on commit 15cbf42

Please sign in to comment.