diff options
author | dgp <dgp@users.sourceforge.net> | 2004-02-25 23:38:14 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2004-02-25 23:38:14 (GMT) |
commit | ef0b541994832ec80dd874d09c0887d2f55716aa (patch) | |
tree | 3ebec546b31e48e9389e4c0bc0a55927e5a295e6 /tests/cmdMZ.test | |
parent | 55a84d83113bfd6b1c28779a61f92ea760695a96 (diff) | |
download | tcl-ef0b541994832ec80dd874d09c0887d2f55716aa.zip tcl-ef0b541994832ec80dd874d09c0887d2f55716aa.tar.gz tcl-ef0b541994832ec80dd874d09c0887d2f55716aa.tar.bz2 |
* tests/basic.test: Made several tests more robust to the
* tests/cmdMZ.test: list-quoting of path names that might
* tests/exec.test: contain Tcl-special chars like { or [.
* tests/io.test: Should help us sort out Tcl Bug 554068.
* tests/pid.test:
* tests/socket.test:
* tests/source.test:
* tests/unixInit.test:
Diffstat (limited to 'tests/cmdMZ.test')
-rw-r--r-- | tests/cmdMZ.test | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index 8835764..1e9a58a 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -11,10 +11,10 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: cmdMZ.test,v 1.13.2.2 2003/11/12 17:29:10 hobbs Exp $ +# RCS: @(#) $Id: cmdMZ.test,v 1.13.2.3 2004/02/25 23:38:16 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest 2 + package require tcltest 2.1 namespace import -force ::tcltest::* } @@ -84,16 +84,31 @@ test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} {unixOrPc} { test cmdMZ-3.4 {Tcl_SourceObjCmd: error conditions} {unixOrPc} { list [catch {source a b} msg] $msg } {1 {wrong # args: should be "source fileName"}} -test cmdMZ-3.5 {Tcl_SourceObjCmd: error in script} -body { + +proc ListGlobMatch {expected actual} { + if {[llength $expected] != [llength $actual]} { + return 0 + } + foreach e $expected a $actual { + if {![string match $e $a]} { + return 0 + } + } + return 1 +} +customMatch listGlob ListGlobMatch + +test cmdMZ-3.5 {Tcl_SourceObjCmd: error in script} -setup { set file [makeFile { set x 146 error "error in sourced file" set y $x } source.file] - set result [list [catch {source $file} msg] $msg $errorInfo] +} -body { + list [catch {source $file} msg] $msg $errorInfo +} -cleanup { removeFile source.file - set result -} -match glob -result {1 {error in sourced file} {error in sourced file +} -match listGlob -result {1 {error in sourced file} {error in sourced file while executing "error "error in sourced file"" (file "*" line 3) |