🕸️ Try-Catch
This commit is contained in:
@ -102,5 +102,11 @@ tests =
|
||||
eval [] (Apply (Let "x" (CstInt 2) (Lambda "y" (Add (Var "x") (Var "y")))) (CstInt 3))
|
||||
@?= Right (ValInt 5),
|
||||
testCase "Apply (fact)" $
|
||||
eval envEmpty (Apply fact (CstInt 5)) @?= Right (ValInt 120)
|
||||
eval envEmpty (Apply fact (CstInt 5)) @?= Right (ValInt 120),
|
||||
testCase "Try" $
|
||||
eval envEmpty (TryCatch (CstInt 0) (CstInt 1))
|
||||
@?= Right (ValInt 0),
|
||||
testCase "Catch" $
|
||||
eval envEmpty (TryCatch (Var "missing") (CstInt 1))
|
||||
@?= Right (ValInt 1)
|
||||
]
|
||||
|
Reference in New Issue
Block a user