summaryrefslogtreecommitdiffstats
path: root/tests/cmdMZ.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-07-01 07:52:02 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-07-01 07:52:02 (GMT)
commitad1ccfdeba286542f72f1f58a8387d32a66eae80 (patch)
tree4eb1829723d0b43f31aa865b86bf3afa33d292ea /tests/cmdMZ.test
parent688fa3e8e5fa9917e24ef78bddcbbfae8f20c80c (diff)
downloadtcl-ad1ccfdeba286542f72f1f58a8387d32a66eae80.zip
tcl-ad1ccfdeba286542f72f1f58a8387d32a66eae80.tar.gz
tcl-ad1ccfdeba286542f72f1f58a8387d32a66eae80.tar.bz2
* Updated the instructions on running and adding to the test suite.
Also updated several tests, mostly to correctly create and destroy any temporary files in the [temporaryDirectory] of tcltest.
Diffstat (limited to 'tests/cmdMZ.test')
-rw-r--r--tests/cmdMZ.test24
1 files changed, 14 insertions, 10 deletions
diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test
index d2a57f9..cf7a1a9 100644
--- a/tests/cmdMZ.test
+++ b/tests/cmdMZ.test
@@ -11,7 +11,7 @@
# 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.9 2001/11/23 01:25:54 das Exp $
+# RCS: @(#) $Id: cmdMZ.test,v 1.10 2002/07/01 07:52:02 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -85,22 +85,26 @@ 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} {
- makeFile {
+test cmdMZ-3.5 {Tcl_SourceObjCmd: error in script} -body {
+ set file [makeFile {
set x 146
error "error in sourced file"
set y $x
- } source.file
- list [catch {source source.file} msg] $msg $errorInfo
-} {1 {error in sourced file} {error in sourced file
+ } source.file]
+ 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
while executing
"error "error in sourced file""
- (file "source.file" line 3)
+ (file "*" line 3)
invoked from within
-"source source.file"}}
+"source $file"}}
test cmdMZ-3.6 {Tcl_SourceObjCmd: simple script} {
- makeFile {list result} source.file
- source source.file
+ set file [makeFile {list result} source.file]
+ set result [source $file]
+ removeFile source.file
+ set result
} result
# Tcl_SplitObjCmd