diff --git a/common/TestUtils.hs b/common/TestUtils.hs index d324ab7..dc4a67b 100644 --- a/common/TestUtils.hs +++ b/common/TestUtils.hs @@ -457,3 +457,8 @@ assertEitherFail testName result = case result of Left _ -> return () 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