summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-08-21 09:35:50 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-08-21 09:35:50 (GMT)
commit7ef78ec33dcd4cf57d272e36d542a1c3c088495a (patch)
treedda46e1bf0558061c91fd63c933ad7a3254b4647
parent9feda62fe0318715623c455abe7289bbb7dec34e (diff)
downloadtcl-7ef78ec33dcd4cf57d272e36d542a1c3c088495a.zip
tcl-7ef78ec33dcd4cf57d272e36d542a1c3c088495a.tar.gz
tcl-7ef78ec33dcd4cf57d272e36d542a1c3c088495a.tar.bz2
define tests for this bug; no fix yet
-rw-r--r--tests/oo.test30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index e0e0791..054bc46 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -1839,6 +1839,36 @@ test oo-15.9 {ensemble rewriting must not bleed through oo::copy} -setup {
} -returnCodes error -cleanup {
Foo destroy
} -result {wrong # args: should be "::bar <cloned> a b"}
+test oo-15.10 {variable binding must not bleed through oo::copy} -setup {
+ oo::class create FooClass
+ set result {}
+} -body {
+ set obj1 [FooClass new]
+ oo::objdefine $obj1 {
+ variable var
+ method m {} {
+ set var foo
+ }
+ method get {} {
+ return $var
+ }
+ export eval
+ }
+
+ $obj1 m
+ lappend result [$obj1 get]
+ set obj2 [oo::copy $obj1]
+ $obj2 eval {
+ set var bar
+ }
+ lappend result [$obj2 get]
+ $obj1 eval {
+ set var grill
+ }
+ lappend result [$obj1 get] [$obj2 get]
+} -cleanup {
+ FooClass destroy
+} -result {foo bar grill bar}
test oo-16.1 {OO: object introspection} -body {
info object