tagged release 0.6.4
[parrot.git] / languages / tcl / t / cmd_continue.t
blob2b0e741032c52a827f10b729564eb6ec06342299
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 4
15 eval_is {
16  set result ""
17  for {set a 0} {$a < 10} {incr a} {
18    if {$a > 5} { continue }
19    set result [append result $a]
20  }
21  list $a $result
22 } {10 012345} {continue from for}
24 eval_is {
25  set result ""
26  set a 0
27  while {$a <= 10} {
28    incr a
29    if {$a < 5} { continue }
30    set result [append result $a]
31  }
32  list $a $result
33 } {11 567891011} {continue from while}
35 eval_is {
36   proc test {} {continue}
37   test
38 } {invoked "continue" outside of a loop} \
39   {continue outside of a loop}
41 eval_is {
42   proc test {} {continue}
43   for {set i 0} {$i < 5} {incr i} {test}
44 } {invoked "continue" outside of a loop} \
45   {continue in a proc called in a loop}