From 3046d041c02be38e96e7d08045486bd739f84cf7 Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 18 Jan 2007 11:05:25 +0000 Subject: Detect [Bug 1638414] --- ChangeLog | 4 ++++ tests/compile.test | 29 ++++++----------------------- 2 files changed, 10 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52ea1b4..3ebdd50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-01-18 Donal K. Fellows + + * tests/compile.test (compile-16.24): Added test for [Bug 1638414] + 2007-01-17 Donal K. Fellows * generic/tclIO.c: Added macros to make usage of ChannelBuffers diff --git a/tests/compile.test b/tests/compile.test index 2481a81..b18ee9f 100644 --- a/tests/compile.test +++ b/tests/compile.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: compile.test,v 1.44 2006/11/03 00:34:52 hobbs Exp $ +# RCS: @(#) $Id: compile.test,v 1.45 2007/01/18 11:05:26 dkf Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -446,77 +446,61 @@ if $noComp { test compile-16.1.$noComp {TclCompileScript: word expansion} $constraints { run "list [string repeat {{*}a } 255]" } [lrepeat 255 a] - test compile-16.2.$noComp {TclCompileScript: word expansion} $constraints { run "list [string repeat {{*}a } 256]" } [lrepeat 256 a] - test compile-16.3.$noComp {TclCompileScript: word expansion} $constraints { run "list [string repeat {{*}a } 257]" } [lrepeat 257 a] - test compile-16.4.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list} } {} - test compile-16.5.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list {*}{x y z}} } {x y z} - test compile-16.6.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list {*}[list x y z]} } {x y z} - test compile-16.7.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list {*}[list x y z][list x y z]} } {x y zx y z} - test compile-16.8.$noComp {TclCompileScript: word expansion} -body { set l {x y z} run {{*}list {*}$l} } -constraints $constraints -cleanup { unset l } -result {x y z} - test compile-16.9.$noComp {TclCompileScript: word expansion} -body { set l {x y z} run {{*}list {*}$l$l} } -constraints $constraints -cleanup { unset l } -result {x y zx y z} - test compile-16.10.$noComp {TclCompileScript: word expansion} -body { run {{*}\{} } -constraints $constraints -returnCodes error \ -result {unmatched open brace in list} - test compile-16.11.$noComp {TclCompileScript: word expansion} -body { proc badList {} {return \{} run {{*}[badList]} } -constraints $constraints -cleanup { rename badList {} } -returnCodes error -result {unmatched open brace in list} - test compile-16.12.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list x y z} } {x y z} - test compile-16.13.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list x y {*}z} } {x y z} - test compile-16.14.$noComp {TclCompileScript: word expansion} $constraints { run {{*}list x {*}y z} } {x y z} - test compile-16.15.$noComp {TclCompileScript: word expansion} $constraints { run {list x y {*}z} } {x y z} - test compile-16.16.$noComp {TclCompileScript: word expansion} $constraints { run {list x {*}y z} } {x y z} - test compile-16.17.$noComp {TclCompileScript: word expansion} $constraints { run {list {*}x y z} } {x y z} @@ -539,21 +523,18 @@ test compile-16.18.$noComp {TclCompileScript: word expansion} -body { } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -returnCodes ok -result [expr {1<<20}] - test compile-16.19.$noComp {TclCompileScript: word expansion} -body { proc LongList {} {return [lrepeat [expr {1<<11}] x]} llength [run "list [string repeat {{*}[LongList] } [expr {1<<11}]]"] } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -returnCodes ok -result [expr {1<<22}] - test compile-16.20.$noComp {TclCompileScript: word expansion} -body { proc LongList {} {return [lrepeat [expr {1<<12}] x]} llength [run "list [string repeat {{*}[LongList] } [expr {1<<12}]]"] } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -returnCodes ok -result [expr {1<<24}] - # This is the one that should cause overflow test compile-16.21.$noComp {TclCompileScript: word expansion} -body { proc LongList {} {return [lrepeat [expr {1<<16}] x]} @@ -561,7 +542,6 @@ test compile-16.21.$noComp {TclCompileScript: word expansion} -body { } -constraints [linsert $constraints 0 knownBug] -cleanup { rename LongList {} } -returnCodes ok -result [expr {wide(1)<<32}] - test compile-16.22.$noComp { Bug 845412: TclCompileScript: word expansion not mandatory } -body { @@ -571,7 +551,6 @@ test compile-16.22.$noComp { } -constraints $constraints -cleanup { rename ReturnResults {} } -returnCodes ok -result [string trim [string repeat {x } 260]] - test compile-16.23.$noComp { Bug 1032805: defer parse error until run time } -constraints $constraints -body { @@ -584,7 +563,11 @@ test compile-16.23.$noComp { } -cleanup { namespace delete x } -returnCodes ok -result {syntax {}{}} - +test compile-16.24.$noComp { + Bug 1638414: bad list constant as first expanded term +} -body { + run "{*}\"\{foo bar\"" +} -returnCodes error -result {unmatched open brace in list} } ;# End of noComp loop # These tests are messy because it wrecks the interpreter it runs in! -- cgit v0.12