1 parent
5ccb3f3e1a
commit
9d5140c0e2
4 files changed
+74
-17
No files matched your search
@@ -14,7 +14,7 @@ evalsTo rs p = runJalmotUnsafe (Sut.eval p) @?= rs
|
||||
|
||||
test_root = testGroup "stack machine"
|
||||
[ testCase "immediate halt" do
|
||||
evalsTo [ObjImm (ImmInt 3)] [stkP|
|
||||
evalsTo [] [stkP|
|
||||
(define $start
|
||||
(return 0))
|
||||
|]
|
||||
@@ -24,6 +24,18 @@ test_root = testGroup "stack machine"
|
||||
(push! 3)
|
||||
(return 1))
|
||||
|]
|
||||
, testCase "non-tail identity function" do
|
||||
evalsTo [ObjImm (ImmInt 123)] [stkP|
|
||||
(define $id
|
||||
(return 1))
|
||||
(define $c
|
||||
(return 1))
|
||||
(define $start
|
||||
(push! $c)
|
||||
(push! $id)
|
||||
(push! 123)
|
||||
(call 1))
|
||||
|]
|
||||
-- , testCase "return constant" do
|
||||
-- evalsTo [ObjImm (ImmInt 123)] [stkP|
|
||||
-- (define ($start %ktail)
|
||||
|
||||
Reference in new issue
Block a user