diff options
author | dgp <dgp@users.sourceforge.net> | 2008-09-26 21:05:54 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2008-09-26 21:05:54 (GMT) |
commit | 11a39b96c6ee19beca3ef9583139c4a8377bcaa9 (patch) | |
tree | ac5ee07fdd2aa2dae014ee703f1ad89e20eb22d8 /tests | |
parent | 03fe58895ff5d2fff94410b80ecf3fd7907b7948 (diff) | |
download | tcl-11a39b96c6ee19beca3ef9583139c4a8377bcaa9.zip tcl-11a39b96c6ee19beca3ef9583139c4a8377bcaa9.tar.gz tcl-11a39b96c6ee19beca3ef9583139c4a8377bcaa9.tar.bz2 |
TIP #323 IMPLEMENTATION (partial)
* doc/lrepeat.n: Revise [lrepeat] to accept both zero
* generic/tclCmdIL.c: repetitions and zero elements to be repeated.
* tests/lrepeat.test:
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lrepeat.test | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/lrepeat.test b/tests/lrepeat.test index f6888b1..a28dd27 100644 --- a/tests/lrepeat.test +++ b/tests/lrepeat.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: lrepeat.test,v 1.2 2003/10/06 14:32:22 dgp Exp $ +# RCS: @(#) $Id: lrepeat.test,v 1.3 2008/09/26 21:05:57 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -22,14 +22,13 @@ test lrepeat-1.1 {error cases} { lrepeat } -returnCodes 1 - -result {wrong # args: should be "lrepeat positiveCount value ?value ...?"} + -result {wrong # args: should be "lrepeat count ?value ...?"} } -test lrepeat-1.2 {error cases} { +test lrepeat-1.2 {Accept zero elements(TIP 323)} { -body { lrepeat 1 } - -returnCodes 1 - -result {wrong # args: should be "lrepeat positiveCount value ?value ...?"} + -result {} } test lrepeat-1.3 {error cases} { -body { @@ -43,14 +42,13 @@ test lrepeat-1.4 {error cases} { lrepeat -3 1 } -returnCodes 1 - -result {must have a count of at least 1} + -result {bad count "-3": must be integer >= 0} } -test lrepeat-1.5 {error cases} { +test lrepeat-1.5 {Accept zero repetitions (TIP 323)} { -body { lrepeat 0 } - -returnCodes 1 - -result {wrong # args: should be "lrepeat positiveCount value ?value ...?"} + -result {} } test lrepeat-1.6 {error cases} { -body { @@ -59,6 +57,12 @@ test lrepeat-1.6 {error cases} { -returnCodes 1 -result {expected integer but got "3.5"} } +test lrepeat-1.7 {Accept zero repetitions (TIP 323)} { + -body { + lrepeat 0 a b c + } + -result {} +} ## Okay test lrepeat-2.1 {normal cases} { |