aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/Spec.hs9
-rw-r--r--test/scripts/hash-map1.milch6
2 files changed, 14 insertions, 1 deletions
diff --git a/test/Spec.hs b/test/Spec.hs
index f85ecac..e522c9c 100644
--- a/test/Spec.hs
+++ b/test/Spec.hs
@@ -137,7 +137,14 @@ e2eTests = testGroup "e2e" [
let expectedAtomMap = M.singleton (LAtomRef 1) (astInteger 15)
let gotAtomMap = stateAtomMap gotState
- assertEqual "" expectedAtomMap gotAtomMap
+ assertEqual "" expectedAtomMap gotAtomMap,
+
+ do let env = builtinEnv
+ script1 <- readFile "test/scripts/hash-map1.milch"
+ (gotASTs, _) <- expectSuccessL env $ runInlineScript "<test>" script1
+
+ let expectedLastAST = astBoolean True
+ assertEqual "" expectedLastAST (last gotASTs)
]
testGroup label xs = TestLabel label $ TestList $ map TestCase xs
diff --git a/test/scripts/hash-map1.milch b/test/scripts/hash-map1.milch
new file mode 100644
index 0000000..ed61ec0
--- /dev/null
+++ b/test/scripts/hash-map1.milch
@@ -0,0 +1,6 @@
+(let a "foo")
+
+(eq?
+ { a 1 :b 2 }
+ ; equivalent to
+ (hash-map [a 1 :b 2]))