1 # Commands covered: for, continue, break
3 # This file contains the original set of tests for Tcl's for command.
4 # Since the for command is now compiled, a new set of tests covering
5 # the new implementation is in the file "for.test". Sourcing this file
6 # into Tcl runs the tests and generates output for errors.
7 # No output means no errors were found.
9 # Copyright (c) 1991-1993 The Regents of the University of California.
10 # Copyright (c) 1994-1996 Sun Microsystems, Inc.
12 # See the file "license.terms" for information on usage and redistribution
13 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
15 # RCS: @(#) $Id: for-old.test,v 1.5 2000/04/10 17:18:59 ericm Exp $
17 source [file dirname [info script]]/testing.tcl
19 # Check "for" and its use of continue and break.
22 test for-old-1.1 {for tests} {
24 for {set i 1} {$i<6} {set i [expr $i+1]} {
29 test for-old-1.2 {for tests} {
31 for {set i 1} {$i<6} {set i [expr $i+1]} {
37 test for-old-1.3 {for tests} {
39 for {set i 1} {$i<6} {set i [expr $i+1]} {
45 test for-old-1.4 {for tests} {catch {for 1 2 3} msg} 1
46 test for-old-1.5 {for tests} {
49 test for-old-1.6 {for tests} {catch {for 1 2 3 4 5} msg} 1
50 test for-old-1.7 {for tests} {
51 catch {for 1 2 3 4 5} msg
53 test for-old-1.8 {for tests} {
55 for {set i 1} {$i<6} {set i [expr $i+1]} {}
58 test for-old-1.9 {for tests} {
60 for {set i 1} {$i<6} {set i [expr $i+1]; if $i==4 break} {