Skip to content

Commit

Permalink
Added classifiers to comment tests.
Browse files Browse the repository at this point in the history
Classification added to check coverage points of comment lexer testing.
Check for non-empty comments and comments that include a newline symbol.
Related to issue #51.
  • Loading branch information
Matthewar committed Sep 9, 2018
1 parent f122743 commit 95287a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/Spec/Parser/Combinators/Lex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,10 @@ comments = testGroup "Comments"
-- |Tests for valid comments
validComments :: TestTree
validComments = QC.testProperty "Valid comments" $
QC.forAll genComment $ \(ExpectedOutput input expectedRemainder) -> parseIncludeRemainder input == Right expectedRemainder
QC.forAll genComment $ \(ExpectedOutput input expectedRemainder) ->
QC.classify (length input > 2) "non-empty comments"
$ QC.classify (elem '\n' input || elem '\r' input) "comments with newline"
$ parseIncludeRemainder input == Right expectedRemainder
where parseIncludeRemainder = parse (comment *> manyTill anyChar eof) "TEST"

-- |Tests for invalid comments
Expand Down

0 comments on commit 95287a4

Please sign in to comment.