lib: export expectEq' helper
This commit is contained in:
parent
0f83fb91c1
commit
1fced57c81
@ -12,6 +12,7 @@ module Hledger.Utils.Test (
|
|||||||
,_test
|
,_test
|
||||||
,it
|
,it
|
||||||
,_it
|
,_it
|
||||||
|
,expectEq'
|
||||||
,expectParse
|
,expectParse
|
||||||
,expectParseError
|
,expectParseError
|
||||||
,expectParseEq
|
,expectParseEq
|
||||||
@ -101,7 +102,7 @@ runEasyTests args easytests = (do
|
|||||||
-- | Like easytest's expectEq, but pretty-prints the values in the failure output.
|
-- | Like easytest's expectEq, but pretty-prints the values in the failure output.
|
||||||
expectEq' :: (Eq a, Show a, HasCallStack) => a -> a -> E.Test ()
|
expectEq' :: (Eq a, Show a, HasCallStack) => a -> a -> E.Test ()
|
||||||
expectEq' x y = if x == y then E.ok else E.crash $
|
expectEq' x y = if x == y then E.ok else E.crash $
|
||||||
"expected:\n" <> T.pack (pshow x) <> "\nbut got:\n" <> T.pack (pshow y) <> "\n"
|
"\nexpected:\n" <> T.pack (pshow x) <> "\nbut got:\n" <> T.pack (pshow y) <> "\n"
|
||||||
|
|
||||||
-- | Test that this stateful parser runnable in IO successfully parses
|
-- | Test that this stateful parser runnable in IO successfully parses
|
||||||
-- all of the given input text, showing the parse error if it fails.
|
-- all of the given input text, showing the parse error if it fails.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user