Skip to content

Instantly share code, notes, and snippets.

@dmp1ce
Created June 14, 2016 23:17
Show Gist options
  • Save dmp1ce/d47addab578387ac473acf47b2ca2be6 to your computer and use it in GitHub Desktop.
Save dmp1ce/d47addab578387ac473acf47b2ca2be6 to your computer and use it in GitHub Desktop.
module LibSpec where
import Test.Hspec
import Test.Hspec.QuickCheck
import Lib (ourAdd,fun1,fun2,fun1',fun2')
main :: IO ()
main = hspec spec
spec :: Spec
spec =
describe "Lib" $ do
it "works" $ do
True `shouldBe` True
prop "ourAdd is commutative" $ \x y ->
ourAdd x y `shouldBe` ourAdd y x
describe "Exercise 1" $ do
prop "fun1 is the same as fun1'" $ \xs ->
fun1 xs `shouldBe` fun1' xs
prop "fun2 is the same as fun2'" $ \x ->
fun2 x `shouldBe` fun2' x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment