summaryrefslogtreecommitdiffstats
path: root/tests/cmdMZ.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-02-25 23:56:58 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-02-25 23:56:58 (GMT)
commit9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6 (patch)
treec4e71eedeebec78847b456ffa6f2bd451c9a92d3 /tests/cmdMZ.test
parentf8f2edda8715ea332ecf36f0b07d45d662f9a9ff (diff)
downloadtcl-9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6.zip
tcl-9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6.tar.gz
tcl-9f1913a0d8f82a07b0ed1500f3b3d31d3ff0f9c6.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.test23
1 files changed, 19 insertions, 4 deletions
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test
index ce4cffd..50218de 100644
--- a/tests/cmdMZ.test
+++ b/tests/cmdMZ.test
@@ -11,15 +11,16 @@
# 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.19 2003/11/12 17:27:13 hobbs Exp $
+# RCS: @(#) $Id: cmdMZ.test,v 1.20 2004/02/25 23:56:59 dgp Exp $
-if {[catch {package require tcltest 2.0.2}]} {
- puts stderr "Skipping tests in [info script]. tcltest 2.0.2 required."
+if {[catch {package require tcltest 2.1}]} {
+ puts stderr "Skipping tests in [info script]. tcltest 2.1 required."
return
}
namespace eval ::tcl::test::cmdMZ {
namespace import ::tcltest::cleanupTests
+ namespace import ::tcltest::customMatch
namespace import ::tcltest::makeFile
namespace import ::tcltest::removeFile
namespace import ::tcltest::temporaryDirectory
@@ -202,6 +203,20 @@ test cmdMZ-3.4 {Tcl_SourceObjCmd: error conditions} -constraints {
} -body {
list [catch {source a b} msg] $msg
} -match glob -result {1 {wrong # args: should be "source*fileName"}}
+
+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 [namespace which ListGlobMatch]
+
test cmdMZ-3.5 {Tcl_SourceObjCmd: error in script} -body {
set file [makeFile {
set x 146
@@ -211,7 +226,7 @@ test cmdMZ-3.5 {Tcl_SourceObjCmd: error in script} -body {
set result [list [catch {source $file} msg] $msg $errorInfo]
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)