Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d0eb5328c1
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 42 lines (33 sloc) 0.732 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
#!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}
Something went wrong with that request. Please try again.