Added a helper function (assertEqualCustomShow) to the TestUtils module
This commit is contained in:
parent
d3fca1d610
commit
fa7ec6d407
|
@ -457,3 +457,8 @@ assertEitherFail testName result
|
||||||
= case result of
|
= case result of
|
||||||
Left _ -> return ()
|
Left _ -> return ()
|
||||||
Right _ -> assertFailure $ testName ++ "; test expected to fail but passed"
|
Right _ -> assertFailure $ testName ++ "; test expected to fail but passed"
|
||||||
|
|
||||||
|
assertEqualCustomShow :: Eq a => (a -> String) -> String -> a -> a -> Assertion
|
||||||
|
assertEqualCustomShow showFunc testName exp act
|
||||||
|
| exp == act = return ()
|
||||||
|
| otherwise = assertFailure $ testName ++ "\n" ++ "expected: " ++ showFunc exp ++ "\n but got: " ++ showFunc act
|
||||||
|
|
Loading…
Reference in New Issue
Block a user