summaryrefslogtreecommitdiffstats
path: root/tests/lrepeat.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lrepeat.test')
-rw-r--r--tests/lrepeat.test22
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} {