summaryrefslogtreecommitdiff
path: root/lambda-calcul/haskell/test/Minilang/REPLSpec.hs
diff options
context:
space:
mode:
authorArnaud Bailly <arnaud@pankzsoft.com>2025-11-04 08:10:46 +0100
committerArnaud Bailly <arnaud@pankzsoft.com>2025-11-04 08:47:15 +0100
commit1083bb7758a2dfe3f2861bf802627cec16933861 (patch)
tree11bcec09bc5d32eeb72de801bc2337c8098bb728 /lambda-calcul/haskell/test/Minilang/REPLSpec.hs
parent51194425997225de7b7ca83e26b76b9a82f0e10d (diff)
downloadlambda-nantes-1083bb7758a2dfe3f2861bf802627cec16933861.tar.gz
Default REPL to Untyped language
Diffstat (limited to 'lambda-calcul/haskell/test/Minilang/REPLSpec.hs')
-rw-r--r--lambda-calcul/haskell/test/Minilang/REPLSpec.hs20
1 files changed, 10 insertions, 10 deletions
diff --git a/lambda-calcul/haskell/test/Minilang/REPLSpec.hs b/lambda-calcul/haskell/test/Minilang/REPLSpec.hs
index 5469a59..cf6ef01 100644
--- a/lambda-calcul/haskell/test/Minilang/REPLSpec.hs
+++ b/lambda-calcul/haskell/test/Minilang/REPLSpec.hs
@@ -13,17 +13,17 @@ import Prelude hiding (lines, readFile, writeFile)
spec :: Spec
spec = parallel $
describe "MiniLang REPL" $ do
- it "evaluates MiniLang terms read from pure Monad" $ do
+ it "evaluates untyped MiniLang terms read from pure Monad" $ do
let out =
withInput
["((lam (x) x) y)"]
out
`shouldBe` [ "Bye!",
- "y : b"
+ "y : <?>"
]
- it "defaults to try to typecheck terms" $ do
+ it "defaults untyped terms" $ do
let out =
withInput
[ "(let ((Succ (lam (n z s) (s n))) \
@@ -33,13 +33,13 @@ spec = parallel $
out
`shouldBe` [ "Bye!",
- "Cannot unify type variable f with type (e -> f -> e) -> e due to circularity: The variable already occurs in the type."
+ "(lam (z s) (s ((lam (n z s) (s n)) (lam (z s) z)))) : <?>"
]
- it "do not typecheck term when language is set to 'untyped'" $ do
+ it "do typecheck term when language is set to 'Typed'" $ do
let out =
withInput
- [ ":lang Untyped",
+ [ ":lang Typed",
"(let ((Succ (lam (n z s) (s n))) \
\ (Zero (lam (z s) z))) \
\ (Succ (Succ Zero)))"
@@ -47,8 +47,8 @@ spec = parallel $
out
`shouldBe` [ "Bye!",
- "(lam (z s) (s ((lam (n z s) (s n)) (lam (z s) z)))) : <?>",
- "Language set to Untyped"
+ "Cannot unify type variable f with type (e -> f -> e) -> e due to circularity: The variable already occurs in the type.",
+ "Language set to Typed"
]
it "shows error when trying to load a non-existent file" $ do
@@ -65,7 +65,7 @@ spec = parallel $
fileName
"(let ((Succ (lam (n z s) (s n))) \
\ (Zero (lam (z s) z))) \
- \ Zero)"
+ \ (Succ Zero))"
_ <- withFile fileName ReadMode $ \hin ->
withFile outputFileName AppendMode $ \hout ->
@@ -74,7 +74,7 @@ spec = parallel $
out <- readFile outputFileName
out
- `shouldBe` "\955\928> (lam (z s) z) : c -> d -> c\n\955\928> Bye!\n"
+ `shouldBe` "\955\928> (lam (z s) (s (lam (z s) z))) : <?>\n\955\928> Bye!\n"
withTempFile :: (String -> IO ()) -> IO ()
withTempFile =