diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2010-11-18 10:10:13 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2010-11-18 10:10:13 (GMT) |
commit | 80eca273f4b974b66e91dade8b680590398338c4 (patch) | |
tree | 92b725018bf43c0ac6de105fb02c58176397a8e3 /tests | |
parent | 4e232e3df1b018c1bf239180c52fec83d279362d (diff) | |
download | tcl-80eca273f4b974b66e91dade8b680590398338c4.zip tcl-80eca273f4b974b66e91dade8b680590398338c4.tar.gz tcl-80eca273f4b974b66e91dade8b680590398338c4.tar.bz2 |
* tests/oo.test: [Bug 3111059]: Added testing that neatly trapped this
issue.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/oo.test | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/oo.test b/tests/oo.test index 4e3a42e..bea9e1a 100644 --- a/tests/oo.test +++ b/tests/oo.test @@ -7,7 +7,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: oo.test,v 1.41 2010/11/09 14:41:22 dkf Exp $ +# RCS: @(#) $Id: oo.test,v 1.42 2010/11/18 10:10:14 dkf Exp $ package require -exact TclOO 0.6.2 ;# Must match value in generic/tclOO.h if {[lsearch [namespace children] ::tcltest] == -1} { @@ -2615,6 +2615,40 @@ test oo-30.2 {Bug 2903011: deleting an object in a constructor} -setup { } -returnCodes error -cleanup { cls destroy } -result {object deleted in constructor} + +test oo-31.1 {Bug 3111059: when objects and coroutines entangle} -setup { + oo::class create cls +} -constraints memory -body { + oo::define cls { + method justyield {} { + yield + } + constructor {} { + coroutine coro my justyield + } + } + list [leaktest {[cls new] destroy}] [info class instances cls] +} -cleanup { + cls destroy +} -result {0 {}} +test oo-31.2 {Bug 3111059: when objects and coroutines entangle} -setup { + oo::class create cls +} -constraints memory -body { + oo::define cls { + method justyield {} { + yield + } + constructor {} { + coroutine coro my justyield + } + destructor { + rename coro {} + } + } + list [leaktest {[cls new] destroy}] [info class instances cls] +} -cleanup { + cls destroy +} -result {0 {}} cleanupTests return |