diff options
author | hobbs <hobbs> | 2001-08-25 00:08:46 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-08-25 00:08:46 (GMT) |
commit | 7e9026564a47cb082b994611f37bb2ffdd092288 (patch) | |
tree | 6103931277f3ee2c92476c4d1342bfbac77fc72e /tests/stringComp.test | |
parent | 94828be6566ab66759502d691b58a356d6250475 (diff) | |
download | tcl-7e9026564a47cb082b994611f37bb2ffdd092288.zip tcl-7e9026564a47cb082b994611f37bb2ffdd092288.tar.gz tcl-7e9026564a47cb082b994611f37bb2ffdd092288.tar.bz2 |
* tests/stringComp.test: added string-1.3
* generic/tclCompCmds.c (TclCompileStringCmd): changed to return
TCL_OUT_LINE_COMPILE instead of TCL_ERROR when compiling and an
unknown string method is called. This is necessary as the string
command may be never called, or not until 'string' is redefined.
Diffstat (limited to 'tests/stringComp.test')
-rw-r--r-- | tests/stringComp.test | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/stringComp.test b/tests/stringComp.test index 89b641d..fc2214c 100644 --- a/tests/stringComp.test +++ b/tests/stringComp.test @@ -14,7 +14,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: stringComp.test,v 1.2 2001/05/17 02:21:06 hobbs Exp $ +# RCS: @(#) $Id: stringComp.test,v 1.3 2001/08/25 00:08:46 hobbs Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -34,6 +34,15 @@ test string-1.2 {error conditions} { proc foo {} {string} list [catch {foo} msg] $msg } {1 {wrong # args: should be "string option arg ?arg ...?"}} +test string-1.3 {error condition - undefined method during compile} { + # We don't want this to complain about 'never' because it may never + # be called, or string may get redefined. This must compile OK. + proc foo {str i} { + if {"yes" == "no"} { string never called but complains here } + string index $str $i + } + foo abc 0 +} a test string-2.1 {string compare, too few args} { proc foo {} {string compare a} |