mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
clarify expectEq' arguments
This commit is contained in:
parent
f3709f241d
commit
f713a413ff
@ -99,10 +99,11 @@ runEasyTests args easytests = (do
|
||||
)
|
||||
`catch` (\(_::ExitCode) -> return True)
|
||||
|
||||
-- | Like easytest's expectEq, but pretty-prints the values in the failure output.
|
||||
-- | Like easytest's expectEq (asserts the second (actual) value equals the first (expected) value)
|
||||
-- but pretty-prints the values in the failure output.
|
||||
expectEq' :: (Eq a, Show a, HasCallStack) => a -> a -> E.Test ()
|
||||
expectEq' x y = if x == y then E.ok else E.crash $
|
||||
"\nexpected:\n" <> T.pack (pshow x) <> "\nbut got:\n" <> T.pack (pshow y) <> "\n"
|
||||
expectEq' expected actual = if expected == actual then E.ok else E.crash $
|
||||
"\nexpected:\n" <> T.pack (pshow expected) <> "\nbut got:\n" <> T.pack (pshow actual) <> "\n"
|
||||
|
||||
-- | Test that this stateful parser runnable in IO successfully parses
|
||||
-- all of the given input text, showing the parse error if it fails.
|
||||
|
Loading…
Reference in New Issue
Block a user