summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test/Minilang
diff options
context:
space:
mode:
Diffstat (limited to 'lambda-calcul/haskell/test/Minilang')
-rw-r--r--lambda-calcul/haskell/test/Minilang/REPLSpec.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/lambda-calcul/haskell/test/Minilang/REPLSpec.hs b/lambda-calcul/haskell/test/Minilang/REPLSpec.hs
index f6279c1..d23ffbd 100644
--- a/lambda-calcul/haskell/test/Minilang/REPLSpec.hs
+++ b/lambda-calcul/haskell/test/Minilang/REPLSpec.hs
@@ -36,6 +36,20 @@ spec = parallel $
"Cannot unify type variable f with type (e -> f -> e) -> e due to circularity: The variable already occurs in the type."
]
+ it "do not typecheck term when language is set to 'untyped'" $ do
+ let out =
+ withInput
+ [ ":lang Untyped",
+ "(let ((Succ (lam (n z s) (s n))) \
+ \ (Zero (lam (z s) z))) \
+ \ (Succ (Succ Zero)))"
+ ]
+
+ out
+ `shouldBe` [ "Bye!",
+ "(lam (z s) (s ((lam (n z s) (s n)) (lam (z s) z)))) : <?>"
+ ]
+
it "shows error when trying to load a non-existent file" $ do
withInput [":load foo"]
`shouldBe` [ "Bye!",