summaryrefslogtreecommitdiffstats
path: root/tests/coroutine.test
diff options
context:
space:
mode:
authormig <mig>2011-04-11 10:37:39 (GMT)
committermig <mig>2011-04-11 10:37:39 (GMT)
commit084e0e3592fe3bef1db12395401090e9d317c590 (patch)
tree1f3e4c52bddeb57ff9a613cd7cbe551508c36206 /tests/coroutine.test
parentef309fcd9588574626469b6b0d0e169dbf0e097c (diff)
downloadtcl-084e0e3592fe3bef1db12395401090e9d317c590.zip
tcl-084e0e3592fe3bef1db12395401090e9d317c590.tar.gz
tcl-084e0e3592fe3bef1db12395401090e9d317c590.tar.bz2
insure that 'coroutine eval' runs the initial command in the proper context, [Bug 3282869]
Diffstat (limited to 'tests/coroutine.test')
-rw-r--r--tests/coroutine.test24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/coroutine.test b/tests/coroutine.test
index 4d7e3de..bc72017 100644
--- a/tests/coroutine.test
+++ b/tests/coroutine.test
@@ -435,6 +435,30 @@ test coroutine-4.5 {bug #2724403} -constraints {memory} \
unset i ns start end
} -result 0
+test coroutine-4.6 {compile context, bug #3282869} -setup {
+ unset ::x
+ proc f x {
+ coroutine D eval {yield X$x;yield Y}
+ }
+} -body {
+ f 12
+} -cleanup {
+ rename f {}
+} -returnCodes error -match glob -result {can't read *}
+
+test coroutine-4.7 {compile context, bug #3282869} -setup {
+ proc f x {
+ coroutine D eval {yield X$x;yield Y$x}
+ }
+} -body {
+ set ::x 15
+ set ::x [f 12]
+ D
+} -cleanup {
+ unset ::x
+ rename f {}
+} -result YX15
+
test coroutine-5.1 {right numLevels on coro return} -constraints {testnrelevels} \
-setup {
proc nestedYield {{val {}}} {