summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2015-12-11 22:27:30 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2015-12-11 22:27:30 (GMT)
commita1afbb92c4ef37e6c164b74a889f319c8fd343d6 (patch)
tree2196fe9bf6d1f586e239ffe46e19ee54ada2f683 /tests/oo.test
parent215f237f9dcb0bedcb02d73ee24a6ad04715cde7 (diff)
parentae04607901c12a74a8fc87f174e461640a4004d6 (diff)
downloadtcl-empty_bodies.zip
tcl-empty_bodies.tar.gz
tcl-empty_bodies.tar.bz2
merge trunkempty_bodies
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index c83e015..2112f10 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -638,6 +638,57 @@ test oo-3.9 {Bug 2944404: deleting the object in the destructor} -setup {
} -cleanup {
cls destroy
} -result {in destructor}
+test oo-3.10 {Bug 3d96b7076e: killing the object's class in a method call} -setup {
+ oo::class create Super
+} -body {
+ # Only reliably failed in a memdebug build
+ oo::class create Cls {
+ superclass Super
+ method mthd {} {
+ [self class] destroy
+ return ok
+ }
+ }
+ [Cls new] mthd
+} -cleanup {
+ Super destroy
+} -result ok
+test oo-3.11 {Bug 3d96b7076e: killing the object's class in a method call} -setup {
+ oo::class create Super
+ oo::class create Sub {
+ superclass Super
+ }
+} -body {
+ # Only reliably failed in a memdebug build
+ oo::class create Cls {
+ superclass Super
+ method mthd {} {
+ oo::objdefine [self] class Sub
+ Cls destroy
+ return ok
+ }
+ }
+ [Cls new] mthd
+} -cleanup {
+ Super destroy
+} -result ok
+test oo-3.12 {Bug 3d96b7076e: killing the object's class in a method call} -setup {
+ oo::class create Super
+} -body {
+ # Only reliably failed in a memdebug build
+ oo::class create Cls {
+ superclass Super
+ method mthd {} {
+ [self class] destroy
+ return ok
+ }
+ }
+ set o [Super new]
+ oo::objdefine $o mixin Cls
+ $o mthd
+} -cleanup {
+ Super destroy
+} -result ok
test oo-4.1 {basic test of OO functionality: export} {
set o [oo::object new]