summaryrefslogtreecommitdiffstats
path: root/tests/foreach.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2013-09-19 12:20:13 (GMT)
committerdgp <dgp@users.sourceforge.net>2013-09-19 12:20:13 (GMT)
commit9c7cec89a95143fb90c190c5c0f6d01424ea1431 (patch)
tree99e3b9a0a6a5a8038009b04e891bdd51ec13462c /tests/foreach.test
parent6ad8909af3c178fac395992cd972c98270bf2e3c (diff)
downloadtcl-9c7cec89a95143fb90c190c5c0f6d01424ea1431.zip
tcl-9c7cec89a95143fb90c190c5c0f6d01424ea1431.tar.gz
tcl-9c7cec89a95143fb90c190c5c0f6d01424ea1431.tar.bz2
Line numbers wrong in compiled foreach body.
Diffstat (limited to 'tests/foreach.test')
-rw-r--r--tests/foreach.test11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/foreach.test b/tests/foreach.test
index 7df7481..ac7a279 100644
--- a/tests/foreach.test
+++ b/tests/foreach.test
@@ -254,6 +254,17 @@ test foreach-9.1 {compiled empty var list} {
list [catch { foo } msg] $msg
} {1 {foreach varlist is empty}}
+test foreach-9.2 {line numbers} -setup {
+ proc linenumber {} {dict get [info frame -1] line}
+} -body {
+ apply {n {
+ foreach x y {*}{
+ } {return [incr n -[linenumber]]}
+ }} [linenumber]
+} -cleanup {
+ rename linenumber {}
+} -result 1
+
test foreach-10.1 {foreach: [Bug 1671087]} -setup {
proc demo {} {
set vals {1 2 3 4}