Closed BebeSparkelSparkel closed 4 years ago
Without quickCheckWith
modifying the test, within
fails properly
fit "within" $
property $ \(s :: String) -> within 1 $ s `shouldBe` s
Can you provide a reproduce case without depending on hspec
, i.e. using only QuickCheck
?
@BebeSparkelSparkel quickCheckWith
is not what you want to use here. Look at https://hackage.haskell.org/package/hspec-2.7.1/docs/Test-Hspec-QuickCheck.html if you want to modify QuickCheck args.
I don't plan to elaborate on this, but in short, quickCheckWith
is of type IO ()
and does not throw and exception on failure. There is no sensible way for Hspec to discover the test outcome if you use quickCheckWith
.
@sol I understand now. Thanks
within
does not cause the test to fail when applied beforequickCheckWith
but works when applied after.This may be an hspec issue but it seems to happen from QuickCheck function ordering.