on master help sign in
Improve test error reporting
commitbd95fac05939e0bd2cbbce40e4acc9d708ba52bb authorlyxia <lysxia@gmail.com> dateWed 13 Sep 2017, 20:30 (9 years ago) parentc857467
1 file changed+4−1
tests/Properties.hs+4−1
tests/Properties.hs+4−1
@@ -143,7 +143,10 @@ parserCatchErrorProp path msg =
143143-- variation in JSON object key ordering.
144144sameAs :: (a -> Value) -> (a -> Encoding) -> a -> Property
145145sameAs 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
148151sameAs1
149152 :: (forall a. LiftToJSON f a)