diff options
author | stanton <stanton> | 1999-04-02 23:44:37 (GMT) |
---|---|---|
committer | stanton <stanton> | 1999-04-02 23:44:37 (GMT) |
commit | b6ed0b400ee9468494ba3dec099f54ffd750f47d (patch) | |
tree | 2c533d489c21163c31afb03aafbab688e0af897f /tests/while.test | |
parent | a8b5f93acd31fa291a03d306957756bc7e2fb1fc (diff) | |
download | tcl-b6ed0b400ee9468494ba3dec099f54ffd750f47d.zip tcl-b6ed0b400ee9468494ba3dec099f54ffd750f47d.tar.gz tcl-b6ed0b400ee9468494ba3dec099f54ffd750f47d.tar.bz2 |
* tests/expr.test:
* tests/for-old.test:
* tests/for.test:
* tests/foreach.test:
* tests/format.test:
* tests/httpold.test:
* tests/if.test:
* tests/init.test:
* tests/interp.test:
* tests/while.test: Added some tests for known bugs (marked with
knownBug constraint), and cleaned up a few bad tests.
Diffstat (limited to 'tests/while.test')
-rw-r--r-- | tests/while.test | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/while.test b/tests/while.test index 1bc1b6b..b98f065 100644 --- a/tests/while.test +++ b/tests/while.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: while.test,v 1.1.2.5 1999/03/24 02:49:51 hershey Exp $ +# RCS: @(#) $Id: while.test,v 1.1.2.6 1999/04/02 23:44:39 stanton Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { source [file join [pwd] [file dirname [info script]] defs.tcl] @@ -27,11 +27,12 @@ test while-1.1 {TclCompileWhileCmd: missing test expression} { } {wrong # args: should be "while test command"} test while-1.2 {TclCompileWhileCmd: error in test expression} { set i 0 - catch {while {$i<}} msg + catch {while {$i<} break} msg set errorInfo -} {wrong # args: should be "while test command" +} {syntax error in expression "$i<" + ("while" test expression) while compiling -"while {$i<}"} +"while {$i<} break"} test while-1.3 {TclCompileWhileCmd: error in test expression} { set err [catch {while {"a"+"b"} {error "loop aborted"}} msg] list $err $msg @@ -605,6 +606,16 @@ test while-6.5 {continue tests, long command body with computed command names} { set a } {1 3} +# Test for incorrect "double evaluation" semantics + +test while-7.1 {delayed substitution of body} {knownBug} { + set i 0 + while {[incr i] < 10} " + set result $i + " + set result +} {0} + # cleanup ::tcltest::cleanupTests return |