Skip to content

Commit

Permalink
Merge pull request #7 from Bodigrim/failing-test
Browse files Browse the repository at this point in the history
Make prop_ppDiffR more robust.   16 tests pass.
  • Loading branch information
ddssff authored Oct 19, 2023
2 parents 8799435 + af7b3b8 commit 026aef2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ main = defaultMain [ testGroup "sub props" [
testProperty "self generates empty" $ forAll shortLists prop_ppDiffEqual,
--testProperty "compare our lists with diff" $ forAll2 shortLists prop_ppDiffShort,
testProperty "compare random with diff" prop_ppDiffR,
testProperty "compare with diff, issue #5" $ prop_ppDiffR
(DiffInput
{ diLeft = ["1","2","3","4","","5","6","7"]
, diRight = ["1","2","3","q","b","u","l","","XXX6",""]
}),
testProperty "test parse" prop_parse,
testProperty "test context" prop_context_diff
]
Expand Down Expand Up @@ -138,7 +143,7 @@ prop_ppDiffR (DiffInput le ri) =
utilDiff= unsafePerformIO (runDiff (unlines le) (unlines ri))
in cover 90 (haskDiff == utilDiff) "exact match" $
classify (haskDiff == utilDiff) "exact match"
(div ((length haskDiff)*100) (length utilDiff) < 110) -- less than 10% bigger
(div ((length (lines haskDiff))*100) (length (lines utilDiff)) < 110) -- less than 10% bigger
where
runDiff left right =
do leftFile <- writeTemp left
Expand Down

0 comments on commit 026aef2

Please sign in to comment.