summaryrefslogtreecommitdiffstats
path: root/tests/env.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-22 11:42:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-02-22 11:42:09 (GMT)
commit58678c630d56e744440b1f808e9fa57aba09fed9 (patch)
treefdd7aef9911da2e29cc5b1c96e0ada1c8b02c8b1 /tests/env.test
parentf7ea5b6cc57fafcbcb3377e83fdbc4d999d123d4 (diff)
parent3a234ba343433d741a7a0c873702da6cb7987ae5 (diff)
downloadtcl-58678c630d56e744440b1f808e9fa57aba09fed9.zip
tcl-58678c630d56e744440b1f808e9fa57aba09fed9.tar.gz
tcl-58678c630d56e744440b1f808e9fa57aba09fed9.tar.bz2
Fix [9b47029467631832]: testing existence of env(some_thing) destroys traces. With test-case demonstrating the problem.
Diffstat (limited to 'tests/env.test')
-rw-r--r--tests/env.test13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/env.test b/tests/env.test
index 83d99e0..f9df4d6 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -314,6 +314,19 @@ test env-7.2 {[219226]: links to env elements should not be removed by read} {
}}
} ok
+test env-7.3 {[9b4702]: testing existence of env(some_thing) should not destroy trace} {
+ apply {{} {
+ 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)
+ }}
+} 1
+
# Restore the environment variables at the end of the test.
foreach name [array names env] {