diff options
author | dgp <dgp@users.sourceforge.net> | 2013-09-16 18:59:14 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2013-09-16 18:59:14 (GMT) |
commit | b0e7980ba4b61bfc9867143b3a08fe0d74894690 (patch) | |
tree | beaad334c814a35e3e90e6297ed8886ee837c853 /tests/oo.test | |
parent | ee5dada68d84581a9b0c3ac970c11b862f0eb186 (diff) | |
parent | fe8ae4eafcd82339318ba2c288431d00bbee06d9 (diff) | |
download | tcl-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.test | 30 |
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 |