✨
This commit is contained in:
@ -94,6 +94,11 @@ evalTests =
|
||||
(Print "Test" (Lambda "x" (Mul (Var "x") (Var "x"))))
|
||||
@?= (["Test: #<fun>"], Right (ValFun [] "x" (Mul (Var "x") (Var "x")))),
|
||||
--
|
||||
testCase "Print (Multiple)" $
|
||||
eval'
|
||||
(Let "x" (Print "Test1" $ CstInt 2) (Print "Test2" $ CstInt 3))
|
||||
@?= (["Test1: 2", "Test2: 3"], Right (ValInt 3)),
|
||||
--
|
||||
testCase "KvPut" $
|
||||
eval'
|
||||
(KvPut (CstInt 1) (CstInt 2))
|
||||
@ -102,7 +107,12 @@ evalTests =
|
||||
testCase "KvGet" $
|
||||
eval'
|
||||
(Let "x" (KvPut (CstInt 0) (CstBool True)) (Let "y" (KvPut (CstInt 0) (CstBool False)) (KvGet (CstInt 0))))
|
||||
@?= ([], Right (ValBool False))
|
||||
@?= ([], Right (ValBool False)),
|
||||
--
|
||||
testCase "TryCatch (key-value)" $
|
||||
eval'
|
||||
(TryCatch (Let "x" (KvPut (CstInt 5) (CstInt 1)) (Var "y")) (KvGet (CstInt 5)))
|
||||
@?= ([], Right (ValInt 1))
|
||||
]
|
||||
|
||||
tests :: TestTree
|
||||
|
Reference in New Issue
Block a user