tagged release 0.6.4
[parrot.git] / languages / tcl / t / cmd_lrepeat.t
blob3cf9bb785b75d46c7d948080718d131d0e6e2944
1 #!perl
3 # Copyright (C) 2004-2006, The Perl Foundation.
4 # $Id$
6 # the following lines re-execute this as a tcl script
7 # the \ at the end of these lines makes them a comment in tcl \
8 use lib qw(languages/tcl/lib tcl/lib lib ../lib ../../lib); # \
9 use Tcl::Test; #\
10 __DATA__
12 source lib/test_more.tcl
13 plan 9
15 is [lrepeat 1 a]   a         {1x1}
16 is [lrepeat 1 a b] {a b}     {1x2}
17 is [lrepeat 2 a]   {a a}     {2x1}
18 is [lrepeat 2 a b] {a b a b} {2x2}
20 is [lrepeat 2 [list a b]] {{a b} {a b}} {nested lists}
23 eval_is {lrepeat} \
24   {wrong # args: should be "lrepeat positiveCount value ?value ...?"} \
25   {too few args}
27 eval_is {lrepeat -1 2} \
28   {must have a count of at least 1} \
29   {negative count}
31 eval_is {lrepeat 0 2} \
32   {must have a count of at least 1} \
33   {zero count}
35 eval_is {lrepeat 0.2 2} \
36   {expected integer but got "0.2"} \
37   {noninteger count}