Created
March 23, 2015 18:30
-
-
Save cammckinnon/21aa2bf99fb6eb29f3ec to your computer and use it in GitHub Desktop.
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
-- to use, type the following in the commandline: runhaskell tests.hs | |
expect :: (Eq a, Show a, Monad m) => a -> a -> m () | |
expect a b = do | |
if a == b then | |
return () | |
else | |
fail ("Expected " ++ (show a) ++ " but got " ++ (show b) ++ " instead.") | |
main = do | |
expect 1 1 | |
expect 1 2 | |
print "All tests passed" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment