diff options
author | andreas_kupries <akupries@shaw.ca> | 2008-07-23 20:49:50 (GMT) |
---|---|---|
committer | andreas_kupries <akupries@shaw.ca> | 2008-07-23 20:49:50 (GMT) |
commit | a0900a49110c0eaf5ed791ee35c70b800d3d52ec (patch) | |
tree | b3d4d81cfc5d42e2154a618ae44c9a9da166f612 /tests | |
parent | 16253514a3a86502bec2e5b592f4c0789641535d (diff) | |
download | tcl-a0900a49110c0eaf5ed791ee35c70b800d3d52ec.zip tcl-a0900a49110c0eaf5ed791ee35c70b800d3d52ec.tar.gz tcl-a0900a49110c0eaf5ed791ee35c70b800d3d52ec.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')
-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 43fc794..7fd9ec1 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.51 2008/07/21 22:50:36 andreas_kupries Exp $ +# RCS: @(#) $Id: info.test,v 1.52 2008/07/23 20:49:52 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 |