summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2017-04-12 11:49:39 (GMT)
committersebres <sebres@users.sourceforge.net>2017-04-12 11:49:39 (GMT)
commit678ae92ce0730d33fb2f803b6b52c5d7b4670089 (patch)
tree8af3427df6fd2a1467f2fad7f3a9372f7038ac8e /tests
parent948bd5e9965da403d358767ce982c65b3af971ae (diff)
parenta61a0e3df9df21ead49108d82842a48617cb0c09 (diff)
downloadtcl-678ae92ce0730d33fb2f803b6b52c5d7b4670089.zip
tcl-678ae92ce0730d33fb2f803b6b52c5d7b4670089.tar.gz
tcl-678ae92ce0730d33fb2f803b6b52c5d7b4670089.tar.bz2
merge fix-42202ba1e5ff566e
Diffstat (limited to 'tests')
-rw-r--r--tests/coroutine.test39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/coroutine.test b/tests/coroutine.test
index 205da67..fd68567 100644
--- a/tests/coroutine.test
+++ b/tests/coroutine.test
@@ -741,6 +741,45 @@ test coroutine-7.12 {coro floor above street level #3008307} -body {
list
} -result {}
+test coroutine-8.0.0 {coro inject executed} -body {
+ coroutine demo apply {{} { foreach i {1 2} yield }}
+ demo
+ set ::result none
+ tcl::unsupported::inject demo set ::result inject-executed
+ demo
+ set ::result
+} -result {inject-executed}
+test coroutine-8.0.1 {coro inject after error} -body {
+ coroutine demo apply {{} { foreach i {1 2} yield; error test }}
+ demo
+ set ::result none
+ tcl::unsupported::inject demo set ::result inject-executed
+ lappend ::result [catch {demo} err] $err
+} -result {inject-executed 1 test}
+test coroutine-8.1.1 {coro inject, ticket 42202ba1e5ff566e} -body {
+ interp create slave
+ slave eval {
+ coroutine demo apply {{} { while {1} yield }}
+ demo
+ tcl::unsupported::inject demo set ::result inject-executed
+ }
+ interp delete slave
+} -result {}
+test coroutine-8.1.2 {coro inject with result, ticket 42202ba1e5ff566e} -body {
+ interp create slave
+ slave eval {
+ coroutine demo apply {{} { while {1} yield }}
+ demo
+ tcl::unsupported::inject demo set ::result inject-executed
+ }
+ slave eval demo
+ set result [slave eval {set ::result}]
+
+ interp delete slave
+ set result
+} -result {inject-executed}
+
+
# cleanup
unset lambda