aboutsummaryrefslogtreecommitdiff
path: root/tests/loop.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/loop.test')
-rw-r--r--tests/loop.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/loop.test b/tests/loop.test
index c6144e0..43fe562 100644
--- a/tests/loop.test
+++ b/tests/loop.test
@@ -152,6 +152,15 @@ test loop-2.8 {modify loop var} {
set a
} {1 2 3 4 5}
+# Previously this would leak memory (configure --maintainer)
+test loop-2.9 {fail to set loop var} -body {
+ set i 1
+ loop i(x) 1 6 {
+ incr y
+ }
+ set y
+} -returnCodes error -result {can't set "i(x)": variable isn't array}
+
testreport
break