diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-19 11:53:52 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2020-03-19 11:53:52 -0400 |
commit | 614026f24a4abce603ea3499d7241abd9383de48 (patch) | |
tree | 3a24082038146472b58bd29ffc3db58974d3df51 /tests | |
parent | ee43fea5d80116bd126eaf92b29e3c015634a22d (diff) |
removed old tuple code, found a bug
Diffstat (limited to 'tests')
-rw-r--r-- | tests/defer.toc | 17 | ||||
-rw-r--r-- | tests/defer_expected | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/tests/defer.toc b/tests/defer.toc index 32165e7..6c2a304 100644 --- a/tests/defer.toc +++ b/tests/defer.toc @@ -10,9 +10,26 @@ same ::= fn(n : int) int { x } +thing1 ::= fn() (int, int) { + x := 5; + y := 6; + defer x += 1; + x, y +} + +thing2 ::= fn() x := 5, y := 6 { + defer x += 1; +} + main ::= fn() { io.puti(plusone(3)); io.puti(same(3)); + a, b := thing1(); + c, d := thing2(); + io.puti(a); + io.puti(b); + io.puti(c); + io.puti(d); defer io.puts("deferred from main()"); for i := 1..10 { defer io.puts("deferred from for"); diff --git a/tests/defer_expected b/tests/defer_expected index 99b45e1..e678115 100644 --- a/tests/defer_expected +++ b/tests/defer_expected @@ -1,5 +1,9 @@ 4 3 +5 +6 +6 +6 1 deferred from for 2 |