From a011e43fe1ff1fc1c95a5d4945085903679265e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fjo=CC=88lnir=20A=CC=81sgeirsson?= Date: Thu, 8 Nov 2012 01:11:21 +0900 Subject: [PATCH] Added tests for non local rets --- Tests/lock_nonlocalret.tq | 16 ++++++++++++++++ Tests/nonlocalret.tq | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 Tests/lock_nonlocalret.tq create mode 100644 Tests/nonlocalret.tq diff --git a/Tests/lock_nonlocalret.tq b/Tests/lock_nonlocalret.tq new file mode 100644 index 0000000..b63a661 --- /dev/null +++ b/Tests/lock_nonlocalret.tq @@ -0,0 +1,16 @@ +obj = @123 +a = { + lock obj { + "took lock" print + { + ^^123 + }() + } + ^321 +} + +async a() +wait +lock obj { + "released lock!" print +} diff --git a/Tests/nonlocalret.tq b/Tests/nonlocalret.tq new file mode 100644 index 0000000..71e5fac --- /dev/null +++ b/Tests/nonlocalret.tq @@ -0,0 +1,16 @@ +a = { + b = { + [1,2,3,4] each: { i | + ^^^123 if i > 2 + i print + } + } + ^b +} +b = a() +b print +{ + foo = { ^^123 } \ Force the block to generate a landing pad + "crash please" print + b() print \ This should crash! +}() print