summaryrefslogtreecommitdiffstats
path: root/tests/foreach.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/foreach.test')
-rw-r--r--tests/foreach.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/foreach.test b/tests/foreach.test
index 7df7481..6c69b29 100644
--- a/tests/foreach.test
+++ b/tests/foreach.test
@@ -266,8 +266,18 @@ test foreach-10.1 {foreach: [Bug 1671087]} -setup {
rename demo {}
} -result {}
+test foreach-11.1 {error then dereference loop var (dev bug)} {
+ catch { foreach a 0 b {1 2 3} { error x } }
+ set a
+} 0
+test foreach-11.2 {error then dereference loop var (dev bug)} {
+ catch { foreach a 0 b {1 2 3} { incr a $b; error x } }
+ set a
+} 1
+
# cleanup
catch {unset a}
catch {unset x}
+catch {rename foo {}}
::tcltest::cleanupTests
return