From cb8a60a6ee4e02cddf216ca580ab3790bc310e80 Mon Sep 17 00:00:00 2001 From: "jan.nijtmans" Date: Mon, 22 Feb 2016 12:16:48 +0000 Subject: (cherry-pick): Add test-case for [9b47029467631832]: testing existence of env(some_thing) destroys traces. This demonstrates that Tcl 8.5 doesn't suffer. --- tests/env.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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] { -- cgit v0.12