Last active
August 29, 2015 14:11
-
-
Save johnjcamilleri/b88762b4d6b05942ff46 to your computer and use it in GitHub Desktop.
QuickCheck.Monadic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> 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. |
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
Why is line 14 passing?