diff options
author | andreas_kupries <akupries@shaw.ca> | 2008-07-23 20:47:28 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2008-07-23 20:47:28 (GMT) |
commit | 28dc32c5df7599c1a91f586e9b87c70257bb6954 (patch) | |
tree | 21c7a839952f44078b41504af48b37e2703f39a3 /tests/info.test | |
parent | 4cfb7828a8f1b3a6686c44798c62431003363ff8 (diff) | |
download | tcl-28dc32c5df7599c1a91f586e9b87c70257bb6954.zip tcl-28dc32c5df7599c1a91f586e9b87c70257bb6954.tar.gz tcl-28dc32c5df7599c1a91f586e9b87c70257bb6954.tar.bz2 |
* generic/tclBasic.c: Modified TclArgumentGet to reject pure lists
* generic/tclCmdIL.c: immediately, without search. Reworked setup
* generic/tclCompile.c: of eoFramePtr, doesn't need the line
* tests/info.test: information, more sensible to have everything
on line 1 when eval'ing a pure list. Updated the users of the line
information to special case this based on the frame type (i.e.
TCL_LOCATION_EVAL_LIST). Added a testcase demonstrating the new
behaviour.
Diffstat (limited to 'tests/info.test')
-rw-r--r-- | tests/info.test | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/tests/info.test b/tests/info.test index 63b8a79..5a4dd13 100644 --- a/tests/info.test +++ b/tests/info.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: info.test,v 1.47.2.1 2008/06/16 20:44:32 andreas_kupries Exp $ +# RCS: @(#) $Id: info.test,v 1.47.2.2 2008/07/23 20:47:33 andreas_kupries Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -1301,6 +1301,32 @@ namespace delete foo # ------------------------------------------------------------------------- +test info-34.0 {eval pure list, single line} { + # Basically, counting the newline in the word seen through $foo + # doesn't really make sense. It makes a bit of sense if the word + # would have been a string literal in the command list. + # + # Problem: At the point where we see the list elements we cannot + # distinguish the two cases, thus we cannot switch between + # count/not-count, it is has to be one or the other for all + # cases. Of the two possibilities miguel convinced me that 'not + # counting' is the more proper. + set foo {b + c} + set cmd [list foreach $foo {x y} { + set res [join [lrange [etrace] 0 2] \n] + break + }] + eval $cmd + set res +} {10 {type source line 728 file info.test cmd {info frame $level} proc ::etrace level 0} +9 {type eval line 2 cmd etrace proc ::tcltest::RunTest} +8 {type eval line 1 cmd foreac proc ::tcltest::RunTest}} + +# ------------------------------------------------------------------------- + +# ------------------------------------------------------------------------- + # cleanup catch {namespace delete test_ns_info1 test_ns_info2} ::tcltest::cleanupTests |