aboutsummaryrefslogtreecommitdiff
path: root/tests/Properties.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Properties.hs')
-rw-r--r--tests/Properties.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/Properties.hs b/tests/Properties.hs
index b9550c0..03a7e9a 100644
--- a/tests/Properties.hs
+++ b/tests/Properties.hs
@@ -10,8 +10,6 @@ import Operators (primitives)
10import Parser (Expr (..), parseLispValue, parseQuote) 10import Parser (Expr (..), parseLispValue, parseQuote)
11import Test.QuickCheck 11import Test.QuickCheck
12 12
13addition = fromJust $ lookup "+" primitives
14multiplication = fromJust $ lookup "*" primitives
15 13
16prop_commutativeAdd :: [Integer] -> Property 14prop_commutativeAdd :: [Integer] -> Property
17prop_commutativeAdd xs = 15prop_commutativeAdd xs =
@@ -19,6 +17,7 @@ prop_commutativeAdd xs =
19 where rhs = (unwrap . addition) exprs 17 where rhs = (unwrap . addition) exprs
20 lhs = (unwrap . addition . reverse) exprs 18 lhs = (unwrap . addition . reverse) exprs
21 exprs = map IntLiteral xs 19 exprs = map IntLiteral xs
20 addition = fromJust $ lookup "+" primitives
22 21
23prop_commutativeMul :: [Integer] -> Property 22prop_commutativeMul :: [Integer] -> Property
24prop_commutativeMul xs = 23prop_commutativeMul xs =
@@ -26,6 +25,7 @@ prop_commutativeMul xs =
26 where rhs = (unwrap . multiplication) exprs 25 where rhs = (unwrap . multiplication) exprs
27 lhs = (unwrap . multiplication . reverse) exprs 26 lhs = (unwrap . multiplication . reverse) exprs
28 exprs = map IntLiteral xs 27 exprs = map IntLiteral xs
28 multiplication = fromJust $ lookup "*" primitives
29 29
30return [] 30return []
31runTests = $quickCheckAll 31runTests = $quickCheckAll