summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/asset/run/callstack.et15
-rw-r--r--test/script/run.et22
2 files changed, 37 insertions, 0 deletions
diff --git a/test/asset/run/callstack.et b/test/asset/run/callstack.et
index f500fb6..9e8123b 100644
--- a/test/asset/run/callstack.et
+++ b/test/asset/run/callstack.et
@@ -6,3 +6,18 @@ test AE:
spawn as p
let x = 2
expect /$x/ from p timeout 0.0
+
+def fg:
+ let x = 1
+ guard (x == 0)
+
+test BG:
+ fg
+
+def gg (x):
+ let y = 2
+ guard (x == y)
+
+test CG:
+ let z = 3
+ gg (z)
diff --git a/test/script/run.et b/test/script/run.et
index f7e4f69..392c44e 100644
--- a/test/script/run.et
+++ b/test/script/run.et
@@ -128,3 +128,25 @@ test CallStack:
expect /(run-.*)/ capture done
guard (done == "run-failed")
flush
+
+ send "run BG"
+ expect /match-fail guard failed/
+ expect /match-fail-line .*\/callstack.et:12:5: .*/
+ expect /match-fail-var x 1/
+ expect /match-fail-line .*\/callstack.et:15:5: .*/
+ local:
+ expect /(run-.*)/ capture done
+ guard (done == "run-failed")
+ flush
+
+ send "run CG"
+ expect /match-fail guard failed/
+ expect /match-fail-line .*\/callstack.et:19:5: .*/
+ expect /match-fail-var x 3/
+ expect /match-fail-var y 2/
+ expect /match-fail-line .*\/callstack.et:23:5: .*/
+ expect /match-fail-var z 3/
+ local:
+ expect /(run-.*)/ capture done
+ guard (done == "run-failed")
+ flush