diff options
author | dgp <dgp@users.sourceforge.net> | 2017-06-22 12:25:35 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2017-06-22 12:25:35 (GMT) |
commit | 69201f94bdcef502012a231e2100bceef5062f90 (patch) | |
tree | 318ce059db03075568b505a7caa2624fce436e13 /tests/coroutine.test | |
parent | 6aa0cc7188b6df1dac97b03bc0b9240aa780799b (diff) | |
parent | f57dacd4955b9dd474cfd9d4e4d55cac22990f6c (diff) | |
download | tcl-69201f94bdcef502012a231e2100bceef5062f90.zip tcl-69201f94bdcef502012a231e2100bceef5062f90.tar.gz tcl-69201f94bdcef502012a231e2100bceef5062f90.tar.bz2 |
merge trunktip_463
Diffstat (limited to 'tests/coroutine.test')
-rw-r--r-- | tests/coroutine.test | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/coroutine.test b/tests/coroutine.test index 86fa6e3..07feb53 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 |