assertEq delegates to HUnit.assertEqual
HUnit.assertEqual gives a formatted diff, making it easier to see the differences between the two values at a glance.
This commit is contained in:
parent
0a273d5aae
commit
8028f1defd
@ -544,10 +544,8 @@ htmlQuery = htmlQuery' yedResponse []
|
||||
-- @since 1.5.2
|
||||
assertEq :: (HasCallStack, Eq a, Show a) => String -> a -> a -> YesodExample site ()
|
||||
assertEq m a b =
|
||||
liftIO $ HUnit.assertBool msg (a == b)
|
||||
where msg = "Assertion: " ++ m ++ "\n" ++
|
||||
"First argument: " ++ ppShow a ++ "\n" ++
|
||||
"Second argument: " ++ ppShow b ++ "\n"
|
||||
liftIO $ HUnit.assertEqual msg a b
|
||||
where msg = "Assertion: " ++ m ++ "\n"
|
||||
|
||||
-- | Asserts that the two given values are not equal.
|
||||
--
|
||||
|
||||
Loading…
Reference in New Issue
Block a user