summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/oo.test17
1 files changed, 10 insertions, 7 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 7b816af..4e3a42e 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.40 2010/11/09 14:38:17 dkf Exp $
+# RCS: @(#) $Id: oo.test,v 1.41 2010/11/09 14:41:22 dkf Exp $
package require -exact TclOO 0.6.2 ;# Must match value in generic/tclOO.h
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -97,12 +97,13 @@ test oo-0.7 {cleaning the core class pair; way #2} -setup {
interp delete t
} -result {0 {} 1 {invalid command name "class"}}
test oo-0.8 {leak in variable management} -setup {
- oo::class create foo {
+ oo::class create foo
+} -constraints memory -body {
+ oo::define foo {
constructor {} {
variable v 0
}
}
-} -constraints memory -body {
leaktest {[foo new] destroy}
} -cleanup {
foo destroy
@@ -2056,12 +2057,13 @@ test oo-20.15 {OO: variable method use in non-methods [Bug 2903811]} -setup {
return [set [fooObj varname x]]
} -result ok
test oo-20.16 {variable method: leak per instance} -setup {
- oo::class create foo {
+ oo::class create foo
+} -constraints memory -body {
+ oo::define foo {
constructor {} {
set [my variable v] 0
}
}
-} -constraints memory -body {
leaktest {[foo new] destroy}
} -cleanup {
foo destroy
@@ -2554,13 +2556,14 @@ test oo-27.11 {variables declaration - no instance var leaks with class resolver
list [inst1 value] [inst2 value]
} -result {3 2}
test oo-27.12 {variables declaration: leak per instance} -setup {
- oo::class create foo {
+ oo::class create foo
+} -constraints memory -body {
+ oo::define foo {
variable v
constructor {} {
set v 0
}
}
-} -constraints memory -body {
leaktest {[foo new] destroy}
} -cleanup {
foo destroy