tagged release 0.6.4
[parrot.git] / languages / tcl / t / cmd_while.t
blob438ce85b6e0b9857866ce212c99b827348c56ddc
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 6
15 eval_is {while} \
16   {wrong # args: should be "while test command"} \
17   {while no arg}
19 eval_is {while we} \
20   {wrong # args: should be "while test command"} \
21   {while one arg}
23 eval_is {while we wait outside} \
24   {wrong # args: should be "while test command"} \
25   {while too many args}
27 eval_is {while {"foo"} {}} \
28   {expected boolean value but got "foo"} \
29   {boolean test}
31 eval_is {
32   set a 3
33   set r {}
34   while {$a} {
35     set r "$r$a"
36     incr a -1
37   }
38   set r
39 } {321} {simple while}
41 eval_is {
42  set a ""
43  set i 1
44  while {$i < 6} "append a *;  incr i"
45  set a
46 } {*****} {while with semicolons, command in quotes}