summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-22 12:16:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-22 12:16:48 (GMT)
commitcb8a60a6ee4e02cddf216ca580ab3790bc310e80 (patch)
tree3e737ce1e4b67f7df068d079dba952b6025731ba /tests
parent21fbc4c989efe19518e2c26563c51073425b8098 (diff)
downloadtcl-cb8a60a6ee4e02cddf216ca580ab3790bc310e80.zip
tcl-cb8a60a6ee4e02cddf216ca580ab3790bc310e80.tar.gz
tcl-cb8a60a6ee4e02cddf216ca580ab3790bc310e80.tar.bz2
(cherry-pick): Add test-case for [9b47029467631832]: testing existence of env(some_thing) destroys traces. This demonstrates that Tcl 8.5 doesn't suffer.
Diffstat (limited to 'tests')
-rw-r--r--tests/env.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/env.test b/tests/env.test
index ee13b7f..a7aa162 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -252,6 +252,20 @@ test env-6.1 {corner cases - add lots of env variables} {} {
expr {[array size env] - $size}
} 100
+test env-7.3 {[9b4702]: testing existence of env(some_thing) should not destroy trace} -body {
+ catch {unset ::env(test7_3)}
+ proc foo args {
+ set ::env(test7_3) ok
+ }
+ trace add variable ::env(not_yet_existent) write foo
+ info exists ::env(not_yet_existent)
+ set ::env(not_yet_existent) "Now I'm here";
+ info exists ::env(test7_3)
+} -cleanup {
+ unset ::env(not_yet_existent)
+ unset ::env(test7_3)
+} -result 1
+
# Restore the environment variables at the end of the test.
foreach name [array names env] {