summaryrefslogtreecommitdiffstats
path: root/tests/oo.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2024-07-14 20:06:39 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2024-07-14 20:06:39 (GMT)
commitb733648e8509bdba457d2f7387bd9029be84d2c2 (patch)
tree80fa2151b959ddc3b318e7037ca076da151e684d /tests/oo.test
parentd4a730f62917025a4d2b59a1dd6e630226b1f4f5 (diff)
parent7cb086504f107b8de60f5c8c1c7afddcd0649421 (diff)
downloadtcl-b733648e8509bdba457d2f7387bd9029be84d2c2.zip
tcl-b733648e8509bdba457d2f7387bd9029be84d2c2.tar.gz
tcl-b733648e8509bdba457d2f7387bd9029be84d2c2.tar.bz2
Stop variable from disappearing by accident when referred to by name. [74b6110204]
Diffstat (limited to 'tests/oo.test')
-rw-r--r--tests/oo.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/oo.test b/tests/oo.test
index 0ac7f86..0838827 100644
--- a/tests/oo.test
+++ b/tests/oo.test
@@ -3055,6 +3055,20 @@ test oo-19.3 {OO: varname method and variable decl: Bug 3603695} -setup {
} -cleanup {
testClass destroy
} -result 0
+test oo-19.4 {OO: varname ghosts [Bug 74b6110204]} -setup {
+ oo::class create testClass {
+ export varname
+ self export createWithNamespace
+ }
+ set obj [testClass createWithNamespace testoo19_4 testoo19_4]
+ set ns [info object namespace $obj]
+} -body {
+ set v [$obj varname foo]
+ list [namespace which -variable $v] \
+ [info exists $v] [namespace which -variable $v]
+} -cleanup {
+ testClass destroy
+} -result {::testoo19_4::foo 0 ::testoo19_4::foo}
test oo-20.1 {OO: variable method} -body {
oo::class create testClass {