Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: d0eb5328c1
Fetching contributors…

Cannot retrieve contributors at this time

executable file 42 lines (33 sloc) 0.732 kB
#!perl
# Copyright (C) 2004-2006, The Parrot Foundation.
# the following lines re-execute this as a tcl script
# the \ at the end of these lines makes them a comment in tcl \
use lib qw(lib); # \
use Tcl::Test; #\
__DATA__
source lib/test_more.tcl
plan 4
eval_is {
for {set a 0} {$a < 20} {incr a} {
if {$a > 10} { break }
}
set a
} 11 {break from for}
eval_is {
set a 20
while {$a} {
incr a -1
if {$a < 10} { break }
}
set a
} 9 {break from while}
eval_is {
proc test {} {break}
test
} {invoked "break" outside of a loop} \
{break outside of a loop}
eval_is {
proc test {} {break}
for {set i 0} {$i < 5} {incr i} {test}
} {invoked "break" outside of a loop} \
{break in a proc called in a loop}
Jump to Line
Something went wrong with that request. Please try again.