diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2013-08-21 09:35:50 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2013-08-21 09:35:50 (GMT) |
commit | 7ef78ec33dcd4cf57d272e36d542a1c3c088495a (patch) | |
tree | dda46e1bf0558061c91fd63c933ad7a3254b4647 /tests | |
parent | 9feda62fe0318715623c455abe7289bbb7dec34e (diff) | |
download | tcl-7ef78ec33dcd4cf57d272e36d542a1c3c088495a.zip tcl-7ef78ec33dcd4cf57d272e36d542a1c3c088495a.tar.gz tcl-7ef78ec33dcd4cf57d272e36d542a1c3c088495a.tar.bz2 |
define tests for this bug; no fix yet
Diffstat (limited to 'tests')
-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 |