diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/oo.test | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/oo.test b/tests/oo.test index a976a7d..4c289ab 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.30 2009/10/22 15:39:58 dkf Exp $ +# RCS: @(#) $Id: oo.test,v 1.31 2009/11/24 12:00:08 dkf Exp $ package require TclOO 0.6.1 ;# Must match value in generic/tclOO.h if {[lsearch [namespace children] ::tcltest] == -1} { @@ -2332,6 +2332,23 @@ test oo-29.1 {self class with object-defined methods} -setup { } -returnCodes error -cleanup { obj destroy } -result {method not defined by a class} + +test oo-30.1 {Bug 2903011: deleting an object in a constructor} -setup { + oo::class create cls +} -body { + oo::define cls {constructor {} {[self] destroy}} + cls new +} -returnCodes error -cleanup { + cls destroy +} -result {object deleted in constructor} +test oo-30.2 {Bug 2903011: deleting an object in a constructor} -setup { + oo::class create cls +} -body { + oo::define cls {constructor {} {my destroy}} + cls new +} -returnCodes error -cleanup { + cls destroy +} -result {object deleted in constructor} cleanupTests return |