named constr tests
This commit is contained in:
@@ -27,15 +27,22 @@ spec = do
|
||||
in coreRes `shouldBe` arithRes
|
||||
|
||||
describe "test programs" $ do
|
||||
it "fac 3" $ do
|
||||
it "fac 3" $
|
||||
resultOf Ex.fac3 `shouldBe` Just (NNum 6)
|
||||
|
||||
it "sum [1,2,3]" $ do
|
||||
it "sum [1,2,3]" $
|
||||
resultOf Ex.sumList `shouldBe` Just (NNum 6)
|
||||
|
||||
it "k 3 ((/#) 1 0)" $ do
|
||||
it "k 3 ((/#) 1 0)" $
|
||||
resultOf Ex.constDivZero `shouldBe` Just (NNum 3)
|
||||
|
||||
it "id (case ... of { ... })" $ do
|
||||
it "id (case ... of { ... })" $
|
||||
resultOf Ex.idCase `shouldBe` Just (NNum 5)
|
||||
|
||||
it "bool pattern matching with named constructors" $
|
||||
resultOf Ex.namedBoolCase `shouldBe` Just (NNum 123)
|
||||
|
||||
it "list pattern matching with named constructors" $
|
||||
resultOf Ex.namedConsCase `shouldBe` Just (NNum 6)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user