diff options
author | dgp <dgp@users.sourceforge.net> | 2019-04-17 14:34:42 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2019-04-17 14:34:42 (GMT) |
commit | 05509bdd77f1324b1f0d7c823d04bea37fbcd460 (patch) | |
tree | 05004e7b9b345653df5ab4c8bd8645edac67ac0d /tests/coroutine.test | |
parent | 68c28bd2743bceda75696376f90172170f157015 (diff) | |
download | tcl-05509bdd77f1324b1f0d7c823d04bea37fbcd460.zip tcl-05509bdd77f1324b1f0d7c823d04bea37fbcd460.tar.gz tcl-05509bdd77f1324b1f0d7c823d04bea37fbcd460.tar.bz2 |
Revise coroutines tests so they do not leave behind frame footprints that
can interfere with other tests.
Diffstat (limited to 'tests/coroutine.test')
-rw-r--r-- | tests/coroutine.test | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/tests/coroutine.test b/tests/coroutine.test index 8a5494d..be2b624 100644 --- a/tests/coroutine.test +++ b/tests/coroutine.test @@ -626,19 +626,31 @@ test coroutine-7.5 {return codes} { } set result } {0 1 2 3 4 5} -test coroutine-7.6 {Early yield crashes} { - proc foo args {} - trace add execution foo enter {catch yield} - coroutine demo foo - rename foo {} -} {} +test coroutine-7.6 {Early yield crashes} -setup { + set i [interp create] +} -body { + # Force into a child interpreter [bug 60559fd4a6] + $i eval { + proc foo args {} + trace add execution foo enter {catch yield} + coroutine demo foo + rename foo {} + return ok + } +} -cleanup { + interp delete $i +} -result ok test coroutine-7.7 {Bug 2486550} -setup { - interp hide {} yield + set i [interp create] + $i hide yield } -body { - coroutine demo interp invokehidden {} yield ok + # Force into a child interpreter [bug 60559fd4a6] + $i eval { + coroutine demo interp invokehidden {} yield ok + } } -cleanup { - demo - interp expose {} yield + $i eval demo + interp delete $i } -result ok test coroutine-7.8 {yieldto context nuke: Bug a90d9331bc} -setup { namespace eval cotest {} @@ -780,8 +792,6 @@ test coroutine-8.1.2 {coro inject with result, ticket 42202ba1e5ff566e} -body { interp delete slave set result } -result {inject-executed} - - # cleanup unset lambda |