diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2004-06-23 15:36:52 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2004-06-23 15:36:52 (GMT) |
commit | 917f6e364bb4aaeed6b6e109ce16525d58091193 (patch) | |
tree | 62ce3a9ba3ee31456f0967b7e5e3c7b35c33dd5e /tests/fileName.test | |
parent | 5ce4f325726f9d4a32b7499cc8a0ff0d81a2dc48 (diff) | |
download | tcl-917f6e364bb4aaeed6b6e109ce16525d58091193.zip tcl-917f6e364bb4aaeed6b6e109ce16525d58091193.tar.gz tcl-917f6e364bb4aaeed6b6e109ce16525d58091193.tar.bz2 |
Standardize some use of test constraints onto names that are documented
Diffstat (limited to 'tests/fileName.test')
-rw-r--r-- | tests/fileName.test | 116 |
1 files changed, 58 insertions, 58 deletions
diff --git a/tests/fileName.test b/tests/fileName.test index a5f077d..9c6cbb1 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fileName.test,v 1.42 2004/05/19 20:15:31 dkf Exp $ +# RCS: @(#) $Id: fileName.test,v 1.43 2004/06/23 15:36:56 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -517,7 +517,7 @@ test filename-9.19.1 {Tcl_JoinPath: win} {testsetplatform} { [file join C:/blah {foo\bar}] \ [file join C:/blah C:/blah {foo\bar}] } {foo/bar C:/blah/foo/bar C:/blah/foo/bar} -test filename-9.19.2 {Tcl_JoinPath: win} {testsetplatform winOnly} { +test filename-9.19.2 {Tcl_JoinPath: win} {testsetplatform win} { testsetplatform win set res {} lappend res \ @@ -666,11 +666,11 @@ if {[testConstraint testsetplatform]} { testsetplatform $platform } -test filename-10.23 {Tcl_TranslateFileName} {unixOnly nonPortable} { +test filename-10.23 {Tcl_TranslateFileName} {unix nonPortable} { # this test fails if ~ouster is not /home/ouster list [catch {testtranslatefilename ~ouster} msg] $msg } {0 /home/ouster} -test filename-10.24 {Tcl_TranslateFileName} {unixOnly nonPortable} { +test filename-10.24 {Tcl_TranslateFileName} {unix nonPortable} { # this test fails if ~ouster is not /home/ouster list [catch {testtranslatefilename ~ouster/foo} msg] $msg } {0 /home/ouster/foo} @@ -761,7 +761,7 @@ test filename-11.16 {Tcl_GlobCmd} { set globname "globTest" set horribleglobname "glob\[\{Test" -test filename-11.17 {Tcl_GlobCmd} {unixOnly} { +test filename-11.17 {Tcl_GlobCmd} {unix} { list [catch {lsort [glob -directory $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ @@ -769,7 +769,7 @@ test filename-11.17 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.17.1 {Tcl_GlobCmd} {pcOnly} { +test filename-11.17.1 {Tcl_GlobCmd} {win} { list [catch {lsort [glob -directory $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -891,7 +891,7 @@ test filename-11.17.8 {Tcl_GlobCmd: broken link and glob -l} {symbolicLinkFile} file delete [file join $globname link] set ret } [list 0 [list [file join $globname link]]] -test filename-11.18 {Tcl_GlobCmd} {unixOnly} { +test filename-11.18 {Tcl_GlobCmd} {unix} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ @@ -899,7 +899,7 @@ test filename-11.18 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.18.1 {Tcl_GlobCmd} {pcOnly} { +test filename-11.18.1 {Tcl_GlobCmd} {win} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -908,7 +908,7 @@ test filename-11.18.1 {Tcl_GlobCmd} {pcOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.19 {Tcl_GlobCmd} {unixOnly} { +test filename-11.19 {Tcl_GlobCmd} {unix} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -917,7 +917,7 @@ test filename-11.19 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.19.1 {Tcl_GlobCmd} {pcOnly} { +test filename-11.19.1 {Tcl_GlobCmd} {win} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -951,7 +951,7 @@ if {[file exists $horribleglobname]} { file rename globTest $horribleglobname set globname $horribleglobname -test filename-11.22 {Tcl_GlobCmd} {unixOnly} { +test filename-11.22 {Tcl_GlobCmd} {unix} { list [catch {lsort [glob -dir $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ @@ -959,7 +959,7 @@ test filename-11.22 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.22.1 {Tcl_GlobCmd} {pcOnly} { +test filename-11.22.1 {Tcl_GlobCmd} {win} { list [catch {lsort [glob -dir $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -968,7 +968,7 @@ test filename-11.22.1 {Tcl_GlobCmd} {pcOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.23 {Tcl_GlobCmd} {unixOnly} { +test filename-11.23 {Tcl_GlobCmd} {unix} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname a3]\ @@ -976,7 +976,7 @@ test filename-11.23 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.23.1 {Tcl_GlobCmd} {pcOnly} { +test filename-11.23.1 {Tcl_GlobCmd} {win} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -985,7 +985,7 @@ test filename-11.23.1 {Tcl_GlobCmd} {pcOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.24 {Tcl_GlobCmd} {unixOnly} { +test filename-11.24 {Tcl_GlobCmd} {unix} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -994,7 +994,7 @@ test filename-11.24 {Tcl_GlobCmd} {unixOnly} { [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-11.24.1 {Tcl_GlobCmd} {pcOnly} { +test filename-11.24.1 {Tcl_GlobCmd} {win} { list [catch {lsort [glob -join -path \ [string range $globname 0 5] * *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ @@ -1126,16 +1126,16 @@ test filename-12.1.1 {simple globbing} {unixOrPc} { test filename-12.1.2 {simple globbing} {unixOrPc} { list [catch {glob -types d {}} msg] $msg } {0 .} -test filename-12.1.3 {simple globbing} {unixOnly} { +test filename-12.1.3 {simple globbing} {unix} { list [catch {glob -types hidden {}} msg] $msg } {0 .} -test filename-12.1.4 {simple globbing} {pcOnly} { +test filename-12.1.4 {simple globbing} {win} { list [catch {glob -types hidden {}} msg] $msg } {1 {no files matched glob pattern ""}} -test filename-12.1.5 {simple globbing} {pcOnly} { +test filename-12.1.5 {simple globbing} {win} { list [catch {glob -types hidden c:/} msg] $msg } {1 {no files matched glob pattern "c:/"}} -test filename-12.1.6 {simple globbing} {pcOnly} { +test filename-12.1.6 {simple globbing} {win} { list [catch {glob c:/} msg] $msg } {0 c:/} test filename-12.3 {simple globbing} { @@ -1154,7 +1154,7 @@ test filename-12.5 {simple globbing} { test filename-12.6 {simple globbing} { list [catch {glob globTest\\/\\x1.c} msg] $msg } "0 $globPreResult$x1" -test filename-12.7 {globbing at filesystem root} {unixOnly} { +test filename-12.7 {globbing at filesystem root} {unix} { set res1 [glob -nocomplain /*] set res2 [glob -path / *] set equal [string equal $res1 $res2] @@ -1163,7 +1163,7 @@ test filename-12.7 {globbing at filesystem root} {unixOnly} { } set equal } {1} -test filename-12.8 {globbing at filesystem root} {unixOnly} { +test filename-12.8 {globbing at filesystem root} {unix} { set dir [lindex [glob -type d /*] 0] set first [string range $dir 0 1] set res1 [glob -nocomplain ${first}*] @@ -1174,7 +1174,7 @@ test filename-12.8 {globbing at filesystem root} {unixOnly} { } set equal } {1} -test filename-12.9 {globbing at filesystem root} {winOnly} { +test filename-12.9 {globbing at filesystem root} {win} { # Can't grab just anything from 'file volumes' because we need a dir # that has subdirs - assume that C:/ exists across Windows machines. set dir [lindex [glob -type d C:/*] 0] @@ -1188,7 +1188,7 @@ test filename-12.9 {globbing at filesystem root} {winOnly} { set equal } {1} -test filename-12.10 {globbing with volume relative paths} {winOnly} { +test filename-12.10 {globbing with volume relative paths} {win} { set dir [lindex [glob -type d C:/*] 0] set pwd [pwd] cd C:/ @@ -1276,10 +1276,10 @@ cd $savepwd file rename [file join globTestContext globTest] globTest file delete globTestContext -test filename-14.7 {asterisks, question marks, and brackets} {unixOnly} { +test filename-14.7 {asterisks, question marks, and brackets} {unix} { lsort [glob globTest/*] } {globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.7.1 {asterisks, question marks, and brackets} {pcOnly} { +test filename-14.7.1 {asterisks, question marks, and brackets} {win} { lsort [glob globTest/*] } {globTest/.1 globTest/a1 globTest/a2 globTest/a3 {globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} test filename-14.9 {asterisks, question marks, and brackets} {unixOrPc} { @@ -1314,23 +1314,23 @@ test filename-14.21 {asterisks, question marks, and brackets} { test filename-14.22 {asterisks, question marks, and brackets} { list [catch {glob goo/* x*z foo?q} msg] $msg } {1 {no files matched glob patterns "goo/* x*z foo?q"}} -test filename-14.23 {slash globbing} {unixOnly} { +test filename-14.23 {slash globbing} {unix} { glob / } / -test filename-14.23.2 {slash globbing} {pcOnly} { +test filename-14.23.2 {slash globbing} {win} { glob / } [file norm /] -test filename-14.24 {slash globbing} {pcOnly} { +test filename-14.24 {slash globbing} {win} { glob {\\} } [file norm /] -test filename-14.25 {type specific globbing} {unixOnly} { +test filename-14.25 {type specific globbing} {unix} { list [catch {lsort [glob -dir globTest -types f *]} msg] $msg } [list 0 [lsort [list \ [file join $globname "weird name.c"]\ [file join $globname x,z1.c]\ [file join $globname x1.c]\ [file join $globname y1.c] [file join $globname z1.c]]]] -test filename-14.25.1 {type specific globbing} {pcOnly} { +test filename-14.25.1 {type specific globbing} {win} { list [catch {lsort [glob -dir globTest -types f *]} msg] $msg } [list 0 [lsort [list \ [file join $globname .1]\ @@ -1349,14 +1349,14 @@ unset globname # access by owner, so the following test is not portable. catch {file attributes globTest/a1 -permissions 0000} -test filename-15.1 {unix specific globbing} {unixOnly nonPortable} { +test filename-15.1 {unix specific globbing} {unix nonPortable} { string tolower [list [catch {glob globTest/a1/*} msg] $msg $errorCode] } {1 {couldn't read directory "globtest/a1": permission denied} {posix eacces {permission denied}}} -test filename-15.2 {unix specific no complain: no errors} {unixOnly nonPortable} { +test filename-15.2 {unix specific no complain: no errors} {unix nonPortable} { glob -nocomplain globTest/a1/* } {} test filename-15.3 {unix specific no complain: no errors, good result} \ - {unixOnly nonPortable} { + {unix nonPortable} { # test fails because if an error occur , the interp's result # is reset... glob -nocomplain globTest/a2 globTest/a1/* globTest/a3 @@ -1364,7 +1364,7 @@ test filename-15.3 {unix specific no complain: no errors, good result} \ catch {file attributes globTest/a1 -permissions 0755} test filename-15.4 {unix specific no complain: no errors, good result} \ - {unixOnly nonPortable} { + {unix nonPortable} { # test fails because if an error occurs, the interp's result # is reset... or you don't run at scriptics where the # outser and welch users exists @@ -1376,11 +1376,11 @@ test filename-15.4.1 {no complain: no errors, good result} { string equal [glob -nocomplain ~wontexist ~blah ~] \ [glob -nocomplain ~ ~blah ~wontexist] } {1} -test filename-15.5 {unix specific globbing} {unixOnly nonPortable} { +test filename-15.5 {unix specific globbing} {unix nonPortable} { glob ~ouster/.csh* } "/home/ouster/.cshrc" catch {close [open globTest/odd\\\[\]*?\{\}name w]} -test filename-15.6 {unix specific globbing} {unixOnly} { +test filename-15.6 {unix specific globbing} {unix} { global env set temp $env(HOME) set env(HOME) $env(HOME)/globTest/odd\\\[\]*?\{\}name @@ -1389,7 +1389,7 @@ test filename-15.6 {unix specific globbing} {unixOnly} { set result } [list 0 [list [lindex [glob ~] 0]/globTest/odd\\\[\]*?\{\}name]] catch {file delete -force globTest/odd\\\[\]*?\{\}name} -test filename-15.7 {win specific globbing} {winOnly} { +test filename-15.7 {win specific globbing} {win} { if {[string index [glob ~] end] == "/"} { set res "glob ~ is [glob ~] but shouldn't end in a separator" } else { @@ -1409,7 +1409,7 @@ test filename-15.8 {win and unix specific globbing} {unixOrWin} { # The following tests are only valid for Windows systems. set oldDir [pwd] -if {[testConstraint pcOnly]} { +if {[testConstraint win]} { cd c:/ file delete -force globTest file mkdir globTest @@ -1418,70 +1418,70 @@ if {[testConstraint pcOnly]} { close [open globTest/z1.bat w] } -test filename-16.1 {windows specific globbing} {pcOnly} { +test filename-16.1 {windows specific globbing} {win} { lsort [glob globTest/*.bat] } {globTest/x1.BAT globTest/y1.Bat globTest/z1.bat} -test filename-16.2 {windows specific globbing} {pcOnly} { +test filename-16.2 {windows specific globbing} {win} { list [catch {glob c:} res] $res } {0 c:} -test filename-16.2.1 {windows specific globbing} {pcOnly} { +test filename-16.2.1 {windows specific globbing} {win} { set dir [pwd] cd C:/ set res [list [catch {glob c:} err] $err] cd $dir set res } {0 c:} -test filename-16.3 {windows specific globbing} {pcOnly} { +test filename-16.3 {windows specific globbing} {win} { glob -nocomplain c:\\\\ } c:/ -test filename-16.4 {windows specific globbing} {pcOnly} { +test filename-16.4 {windows specific globbing} {win} { glob -nocomplain c:/ } c:/ -test filename-16.5 {windows specific globbing} {pcOnly} { +test filename-16.5 {windows specific globbing} {win} { glob -nocomplain c:*bTest } c:globTest -test filename-16.6 {windows specific globbing} {pcOnly} { +test filename-16.6 {windows specific globbing} {win} { glob -nocomplain c:\\\\*bTest } c:/globTest -test filename-16.7 {windows specific globbing} {pcOnly} { +test filename-16.7 {windows specific globbing} {win} { glob -nocomplain c:/*bTest } c:/globTest -test filename-16.8 {windows specific globbing} {pcOnly} { +test filename-16.8 {windows specific globbing} {win} { lsort [glob -nocomplain c:globTest/*.bat] } {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat} -test filename-16.9 {windows specific globbing} {pcOnly} { +test filename-16.9 {windows specific globbing} {win} { lsort [glob -nocomplain c:/globTest/*.bat] } {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat} -test filename-16.10 {windows specific globbing} {pcOnly} { +test filename-16.10 {windows specific globbing} {win} { lsort [glob -nocomplain c:globTest\\\\*.bat] } {c:globTest/x1.BAT c:globTest/y1.Bat c:globTest/z1.bat} -test filename-16.11 {windows specific globbing} {pcOnly} { +test filename-16.11 {windows specific globbing} {win} { lsort [glob -nocomplain c:\\\\globTest\\\\*.bat] } {c:/globTest/x1.BAT c:/globTest/y1.Bat c:/globTest/z1.bat} # some tests require a shared C drive -if {[testConstraint pcOnly]} { +if {[testConstraint win]} { testConstraint sharedCdrive [expr {![catch {cd //[info hostname]/c}]}] } -test filename-16.12 {windows specific globbing} {pcOnly sharedCdrive} { +test filename-16.12 {windows specific globbing} {win sharedCdrive} { cd //[info hostname]/c glob //[info hostname]/c/*Test } //[info hostname]/c/globTest -test filename-16.13 {windows specific globbing} {pcOnly sharedCdrive} { +test filename-16.13 {windows specific globbing} {win sharedCdrive} { cd //[info hostname]/c glob "\\\\\\\\[info hostname]\\\\c\\\\*Test" } //[info hostname]/c/globTest -test filename-16.14 {windows specific globbing} {pcOnly} { +test filename-16.14 {windows specific globbing} {win} { cd [lindex [glob -types d -dir C:/ *] 0] expr {[lsearch -exact [glob {{.,*}*}] ".."] != -1} } {1} -test filename-16.15 {windows specific globbing} {pcOnly} { +test filename-16.15 {windows specific globbing} {win} { cd [lindex [glob -types d -dir C:/ *] 0] glob .. } {..} -test filename-16.16 {windows specific globbing} {pcOnly} { +test filename-16.16 {windows specific globbing} {win} { file tail [lindex [glob -nocomplain "[lindex [glob -types d -dir C:/ *] 0]/.."] 0] } {..} @@ -1495,7 +1495,7 @@ if {[testConstraint testsetplatform]} { testsetplatform $platform } -test filename-17.2 {windows specific glob with executable} {winOnly} { +test filename-17.2 {windows specific glob with executable} {win} { makeDirectory execglob makeFile contents execglob/abc.exe makeFile contents execglob/abc.notexecutable |