summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-09-16 18:59:14 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-09-16 18:59:14 (GMT)
commitb0e7980ba4b61bfc9867143b3a08fe0d74894690 (patch)
treebeaad334c814a35e3e90e6297ed8886ee837c853 /tests/oo.test
parentee5dada68d84581a9b0c3ac970c11b862f0eb186 (diff)
parentfe8ae4eafcd82339318ba2c288431d00bbee06d9 (diff)
downloadtcl-b0e7980ba4b61bfc9867143b3a08fe0d74894690.zip
tcl-b0e7980ba4b61bfc9867143b3a08fe0d74894690.tar.gz
tcl-b0e7980ba4b61bfc9867143b3a08fe0d74894690.tar.bz2
merge trunk; update changes
Diffstat (limited to 'tests/oo.test')
-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