diff options
author | dgp <dgp@noemail.net> | 2004-02-25 23:56:57 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2004-02-25 23:56:57 (GMT) |
commit | ec98d42102fd7fec36b6864f91497e5039e21042 (patch) | |
tree | c4e71eedeebec78847b456ffa6f2bd451c9a92d3 /tests/source.test | |
parent | 6266e016dace32ec01d91fa631bbdc0949a76362 (diff) | |
download | tcl-ec98d42102fd7fec36b6864f91497e5039e21042.zip tcl-ec98d42102fd7fec36b6864f91497e5039e21042.tar.gz tcl-ec98d42102fd7fec36b6864f91497e5039e21042.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:
FossilOrigin-Name: 0fb8324d96f8136273a901d03c2b9804166ac966
Diffstat (limited to 'tests/source.test')
-rw-r--r-- | tests/source.test | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tests/source.test b/tests/source.test index 828b9da..ce2e87c 100644 --- a/tests/source.test +++ b/tests/source.test @@ -12,10 +12,10 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: source.test,v 1.10 2003/10/07 21:45:39 dgp Exp $ +# RCS: @(#) $Id: source.test,v 1.11 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 } @@ -25,6 +25,7 @@ namespace eval ::tcl::test::source { namespace import ::tcltest::cleanupTests namespace import ::tcltest::makeFile namespace import ::tcltest::removeFile + namespace import ::tcltest::customMatch test source-1.1 {source command} -setup { set x "old x value" @@ -63,6 +64,18 @@ test source-1.3 {source command} -setup { removeFile source.file } -result {a b c d e f} +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 source-2.3 {source error conditions} -setup { set sourcefile [makeFile { @@ -74,7 +87,7 @@ test source-2.3 {source error conditions} -setup { list [catch {source $sourcefile} msg] $msg $::errorInfo } -cleanup { removeFile source.file -} -match glob -result [list 1 {error in sourced file} \ +} -match listGlob -result [list 1 {error in sourced file} \ {error in sourced file while executing "error "error in sourced file"" @@ -103,7 +116,7 @@ test source-2.6 {source error conditions} -setup { removeFile _non_existent_ } -body { list [catch {source $sourcefile} msg] $msg $::errorCode -} -match glob -result [list 1 \ +} -match listGlob -result [list 1 \ {couldn't read file "*_non_existent_": no such file or directory} \ {POSIX ENOENT {no such file or directory}}] |