aboutsummaryrefslogtreecommitdiffstats
path: root/test/Spec.hs
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2022-12-11 18:45:46 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2022-12-11 18:48:28 +0200
commite0e1c1d7573fc5251fe537314b6a6cfefae09e39 (patch)
treeb68787e42aff081fa23ad733ae73772a94fbc668 /test/Spec.hs
parent3f7d328d356c75c0ae57c67eb64fb5337361cce7 (diff)
Ensure that imports do not overwrite symbols
Diffstat (limited to 'test/Spec.hs')
-rw-r--r--test/Spec.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Spec.hs b/test/Spec.hs
index e522c9c..0059ea7 100644
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -144,7 +144,14 @@ e2eTests = testGroup "e2e" [
(gotASTs, _) <- expectSuccessL env $ runInlineScript "<test>" script1
let expectedLastAST = astBoolean True
- assertEqual "" expectedLastAST (last gotASTs)
+ assertEqual "" expectedLastAST (last gotASTs),
+
+ do let env = M.empty
+ script1 <- readFile "test/scripts/import1.milch"
+ got <- expectErrorL env $ runInlineScript "<test>" script1
+
+ let expected = "error: import shadows symbols: id"
+ assertBool "" (expected `L.isInfixOf` got)
]
testGroup label xs = TestLabel label $ TestList $ map TestCase xs