Skip to content

Commit

Permalink
Add tests using POSIX character classes
Browse files Browse the repository at this point in the history
  • Loading branch information
philderbeast committed Jan 20, 2025
1 parent 9139406 commit 17a848c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cabal-testsuite/AssertTests/cabal.test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,20 @@ main = cabalTest . recordMode RecordMarked $ do
mapM_ log (lines . delimitLines $ encodeLf msg)
assertOn isInfixOf multilineNeedleHaystack msg out
assertOutputContains msg out

assertOutputMatches "^When.*from:$" out
assertOutputMatches "no[-]{1,1}pkg-here" out

assertOutputMatches "else\\.project" out
assertOutputMatches "else\\/else" out
assertOutputMatches "^The f[lo]{4,}wing errors occurred[:]*$" out
assertOutputDoesNotMatch "error occurred" out

assertOutputMatches "^The f[lo]{4,}wing[[:space:]]errors[ ]{1,1}occurred[:]*$" out

assertOutputMatches " errors " out
assertOutputDoesNotMatch " error " out

assertOutputMatches "[[:space:]]+errors[[:space:]]+" out
assertOutputDoesNotMatch "[[:space:]]+error[[:space:]]+" out

log "Pseudo multiline string marking:"
mapM_ log (lines . delimitLines $ encodeLf msgSingle)
Expand Down

0 comments on commit 17a848c

Please sign in to comment.