summaryrefslogtreecommitdiffstats
path: root/tests/foreach.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/foreach.test')
-rw-r--r--tests/foreach.test15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/foreach.test b/tests/foreach.test
index 9f4b5b0..abb88f4 100644
--- a/tests/foreach.test
+++ b/tests/foreach.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: foreach.test,v 1.9 2003/03/27 13:19:15 dkf Exp $
+# RCS: @(#) $Id: foreach.test,v 1.10 2005/10/22 03:37:27 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -233,6 +233,19 @@ test foreach-7.1 {delayed substitution of body} {
foo
} {0}
+
+# Test for [Bug 1189274]; crash on failure
+
+test foreach-8.1 {empty list handling} {
+ proc crash {} {
+ rename crash {}
+ set a "x y z"
+ set b ""
+ foreach aa $a bb $b { set x "aa = $aa bb = $bb" }
+ }
+ crash
+} {}
+
# cleanup
catch {unset a}
catch {unset x}