summaryrefslogtreecommitdiffstats
path: root/tests/env.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2013-09-27 10:29:43 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2013-09-27 10:29:43 (GMT)
commita5a2f896bb91053061b5a83f09cb0778c3b53e3b (patch)
tree16ec0b14f5357ad7601ebefaf5c1e71465d39eba /tests/env.test
parent790f8f7114d0cc7b44cbaddc66e36c877c9c55b6 (diff)
downloadtcl-a5a2f896bb91053061b5a83f09cb0778c3b53e3b.zip
tcl-a5a2f896bb91053061b5a83f09cb0778c3b53e3b.tar.gz
tcl-a5a2f896bb91053061b5a83f09cb0778c3b53e3b.tar.bz2
[219226]: Rewrote how ::env is synchronized to the environment so it no longer
smashes the array or its elements flat, This affects traces on env, links to env, and iterations over env: it makes them work as naïvely expected.
Diffstat (limited to 'tests/env.test')
-rw-r--r--tests/env.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/env.test b/tests/env.test
index fa76433..8115652 100644
--- a/tests/env.test
+++ b/tests/env.test
@@ -291,6 +291,29 @@ test env-6.1 {corner cases - add lots of env variables} {} {
expr {[array size env] - $size}
} 100
+test env-7.1 {[219226]: whole env array should not be unset by read} {
+ set n [array size env]
+ set s [array startsearch env]
+ while {[array anymore env $s]} {
+ array nextelement env $s
+ incr n -1
+ }
+ array donesearch env $s
+ return $n
+} 0
+test env-7.2 {[219226]: links to env elements should not be removed by read} {
+ apply {{} {
+ set ::env(test7_2) ok
+ upvar env(test7_2) elem
+ set ::env(PATH)
+ try {
+ return $elem
+ } finally {
+ unset ::env(test7_2)
+ }
+ }}
+} ok
+
# Restore the environment variables at the end of the test.
foreach name [array names env] {