diff options
author | dgp <dgp@noemail.net> | 2007-03-01 17:55:15 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2007-03-01 17:55:15 (GMT) |
commit | 75f33d990f2e187b2c00e40c1ce9841011aa17da (patch) | |
tree | e551066429291dbd1232fcc21750cdbdddfaa848 /tests/foreach.test | |
parent | 21a1467aa706a6e2a78cd0e14a02662b184d906d (diff) | |
download | tcl-75f33d990f2e187b2c00e40c1ce9841011aa17da.zip tcl-75f33d990f2e187b2c00e40c1ce9841011aa17da.tar.gz tcl-75f33d990f2e187b2c00e40c1ce9841011aa17da.tar.bz2 |
* generic/tclCmdAH.c (Tcl_ForeachObjCmd): Stop throwing away
* tests/foreach.test (foreach-1.14): useful error information when
loop variable sets fail.
FossilOrigin-Name: 7c1b6bc682fbe2a5f2d26263b65b96513d852e75
Diffstat (limited to 'tests/foreach.test')
-rw-r--r-- | tests/foreach.test | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/foreach.test b/tests/foreach.test index 8f452ed..a49ceaa 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.11 2007/03/01 10:07:12 dkf Exp $ +# RCS: @(#) $Id: foreach.test,v 1.12 2007/03/01 17:55:16 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -73,8 +73,11 @@ catch {unset a} test foreach-1.14 {foreach errors} { catch {unset a} set a(0) 44 - list [catch {foreach a {1 2 3} {}} msg] $msg -} {1 {couldn't set loop variable: "a"}} + list [catch {foreach a {1 2 3} {}} msg o] $msg $::errorInfo +} {1 {can't set "a": variable is array} {can't set "a": variable is array + (setting foreach loop variable "a" + invoked from within +"foreach a {1 2 3} {}"}} test foreach-1.15 {foreach errors} { list [catch {foreach {} {} {}} msg] $msg } {1 {foreach varlist is empty}} |