Created
March 8, 2014 21:02
-
-
Save dmjio/9438802 to your computer and use it in GitHub Desktop.
QuickCheck test
This file contains 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
import Test.QuickCheck | |
fac :: Integer -> Integer | |
fac n | n < 1 = 1 | |
| otherwise = n * fac (n - 1) | |
greaterThan0 :: Integer -> Bool | |
greaterThan0 n = not $ (fac n) < 1 | |
main :: IO () | |
main = verboseCheck greaterThan0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment