Skip to content

Commit

Permalink
Remove check for empty match string
Browse files Browse the repository at this point in the history
  • Loading branch information
bchuo authored and cpuguy83 committed Feb 5, 2025
1 parent 8f27234 commit e5badcc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,13 @@ func (c CheckOutput) Check(dt string, p string) (retErr error) {
}
}
for _, matches := range c.Matches {
if matches != "" {
regexp, err := regexp.Compile(matches)
if err != nil {
return err
}

if !regexp.Match([]byte(dt)) {
return &CheckOutputError{Kind: "matches", Expected: matches, Actual: dt, Path: p}
}
regexp, err := regexp.Compile(matches)
if err != nil {
return err
}

if !regexp.Match([]byte(dt)) {
return &CheckOutputError{Kind: "matches", Expected: matches, Actual: dt, Path: p}
}
}

Expand Down

0 comments on commit e5badcc

Please sign in to comment.