summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test18
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 1954d1b..60d0077 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -6,8 +6,6 @@
#
# 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.44 2011/01/18 13:50:03 dkf Exp $
package require -exact TclOO 0.6.2 ;# Must match value in generic/tclOO.h
package require tcltest 2
@@ -2580,6 +2578,22 @@ test oo-27.12 {variables declaration: leak per instance} -setup {
} -cleanup {
foo destroy
} -result 0
+# This test will actually (normally) crash if it fails!
+test oo-27.13 {variables declaration: Bug 3185009: require refcount management} -setup {
+ oo::object create foo
+} -body {
+ oo::objdefine foo {
+ variable x
+ method set v {set x $v}
+ method unset {} {unset x}
+ method exists {} {info exists x}
+ method get {} {return $x}
+ }
+ list [foo exists] [foo set 7] [foo exists] [foo get] [foo unset] \
+ [foo exists] [catch {foo get} msg] $msg
+} -cleanup {
+ foo destroy
+} -result {0 7 1 7 {} 0 1 {can't read "x": no such variable}}
# A feature that's not supported because the mechanism may change without
# warning, but is supposed to work...