Skip to content

Commit bd95fac

Browse files
committed
Improve test error reporting
1 parent c857467 commit bd95fac

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/Properties.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,10 @@ parserCatchErrorProp path msg =
143143
-- variation in JSON object key ordering.
144144
sameAs :: (a -> Value) -> (a -> Encoding) -> a -> Property
145145
sameAs toVal toEnc v =
146-
eitherDecode (encodingToLazyByteString (toEnc v)) === Right (toVal v)
146+
counterexample (show s) $
147+
eitherDecode s === Right (toVal v)
148+
where
149+
s = encodingToLazyByteString (toEnc v)
147150

148151
sameAs1
149152
:: (forall a. LiftToJSON f a)

0 commit comments

Comments
 (0)