From 684e09298b8453ee56571d8a225e11d7c57e3746 Mon Sep 17 00:00:00 2001 From: Akshay Date: Thu, 15 Oct 2020 21:37:00 +0530 Subject: add basic list primitives --- tests/Properties.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/Properties.hs') 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) import Parser (Expr (..), parseLispValue, parseQuote) import Test.QuickCheck -addition = fromJust $ lookup "+" primitives -multiplication = fromJust $ lookup "*" primitives prop_commutativeAdd :: [Integer] -> Property prop_commutativeAdd xs = @@ -19,6 +17,7 @@ prop_commutativeAdd xs = where rhs = (unwrap . addition) exprs lhs = (unwrap . addition . reverse) exprs exprs = map IntLiteral xs + addition = fromJust $ lookup "+" primitives prop_commutativeMul :: [Integer] -> Property prop_commutativeMul xs = @@ -26,6 +25,7 @@ prop_commutativeMul xs = where rhs = (unwrap . multiplication) exprs lhs = (unwrap . multiplication . reverse) exprs exprs = map IntLiteral xs + multiplication = fromJust $ lookup "*" primitives return [] runTests = $quickCheckAll -- cgit v1.2.3