summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/coroutine.test36
1 files changed, 34 insertions, 2 deletions
diff --git a/tests/coroutine.test b/tests/coroutine.test
index e155d09..437d9ad 100644
--- a/tests/coroutine.test
+++ b/tests/coroutine.test
@@ -757,9 +757,9 @@ test coroutine-7.12 {coro floor above street level #3008307} -body {
test coroutine-7.13 {
-issue f9800d52bd61f240
+ issue f9800d52bd61f240
-vwait is not NRE-enabled, and yieldto cannot find the right splicing spot
+ vwait is not NRE-enabled, and yieldto cannot find the right splicing spot
} -body {
coroutine c0 apply [list {} {
variable done
@@ -789,6 +789,38 @@ vwait is not NRE-enabled, and yieldto cannot find the right splicing spot
return $done
} -result 1
+
+test coroutine-7.14 {
+ issue 5106fddd4400e5b9
+
+ failure to yieldto is not the same thing as not calling yieldto in the
+ first place
+} -body {
+ variable done
+ variable done1
+
+ coroutine c0 ::apply [list {} {
+ yield
+ variable done0
+ after 0 [list [namespace which c1]]
+ vwait [namespace current]::done0
+ } [namespace current]]
+
+ coroutine c1 ::apply [list {} {
+ variable done0
+ yield
+ yieldto try "yieldto [list [info coroutine]]" on error {} "
+ ::set [list [namespace current]]::done1 failure
+ ::set [list [namespace current]]::done0 failure
+ "
+ set done0 success
+ } [namespace current]]
+ after 1 [list [namespace which c0]]
+ vwait [namespace current]::done0
+ return [list $done0 $done1]
+} -result {failure failure}
+
+
test coroutine-8.0.0 {coro inject executed} -body {
coroutine demo apply {{} { foreach i {1 2} yield }}
demo