complex expressions
This commit is contained in:
parent
f71984b647
commit
6dda64b0cf
@ -22,5 +22,9 @@ spec = do
|
|||||||
eval (Subtract (Literal 2) (Literal 3) ) `shouldBe` -1
|
eval (Subtract (Literal 2) (Literal 3) ) `shouldBe` -1
|
||||||
eval (Multiply (Literal 2) (Literal 3) ) `shouldBe` 6
|
eval (Multiply (Literal 2) (Literal 3) ) `shouldBe` 6
|
||||||
eval (Divide (Literal 7) (Literal 3) ) `shouldBe` 2
|
eval (Divide (Literal 7) (Literal 3) ) `shouldBe` 2
|
||||||
|
eval (Negate (Literal 7) ) `shouldBe` -7
|
||||||
|
it "more complex arithmetic on literals" $ do
|
||||||
|
eval (Add (Negate (Literal 1)) (Divide (Literal 7) (Literal 3))) `shouldBe` 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user