diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-11 01:37:40 +0200 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2022-12-11 12:51:50 +0200 |
| commit | ca75962a335a9954962b0213e060e3895ddc69fb (patch) | |
| tree | 708407988db3bef5c3c0ddff20f106f39c43e496 /test | |
| parent | d0614dd946baf05375172d7a50f5eb250b9a7b00 (diff) | |
Fix collection literal evaluation
Diffstat (limited to 'test')
| -rw-r--r-- | test/Spec.hs | 9 | ||||
| -rw-r--r-- | test/scripts/hash-map1.milch | 6 |
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])) |
