Skip to content

Instantly share code, notes, and snippets.

@johnjcamilleri
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnjcamilleri/b88762b4d6b05942ff46 to your computer and use it in GitHub Desktop.
Save johnjcamilleri/b88762b4d6b05942ff46 to your computer and use it in GitHub Desktop.
QuickCheck.Monadic
> quickCheck (property True)
+++ OK, passed 100 tests.
> quickCheck (property False)
*** Failed! Falsifiable (after 1 test):
> quickCheck (unsafePerformIO $ return $ property True)
+++ OK, passed 100 tests.
> quickCheck (unsafePerformIO $ return $ property False)
*** Failed! Falsifiable (after 1 test):
> quickCheck (monadicIO $ run $ return $ property True)
+++ OK, passed 100 tests.
> quickCheck (monadicIO $ run $ return $ property False)
+++ OK, passed 100 tests.
@johnjcamilleri
Copy link
Author

Why is line 14 passing?

@johnjcamilleri
Copy link
Author

I was using monadicIO incorrectly. Should be:

> quickCheck (monadicIO $ run (return False) >>= assert)
*** Failed! Assertion failed (after 1 test):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment