diff options
author | dgp <dgp@users.sourceforge.net> | 2012-11-15 17:55:25 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2012-11-15 17:55:25 (GMT) |
commit | 41ace1ce412eda0d4a3034215e72397e4b73571b (patch) | |
tree | a098b4e6b1d3b2a82e4d807dc53a33244eb57d2b /tests | |
parent | 212fc8e012dceb9f0f7a0052601ae83466aaca88 (diff) | |
download | tcl-41ace1ce412eda0d4a3034215e72397e4b73571b.zip tcl-41ace1ce412eda0d4a3034215e72397e4b73571b.tar.gz tcl-41ace1ce412eda0d4a3034215e72397e4b73571b.tar.bz2 |
More complete purge of things only present for supporting long-dead Mac 9 systems.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/all.tcl | 4 | ||||
-rw-r--r-- | tests/binary.test | 11 | ||||
-rw-r--r-- | tests/cmdAH.test | 263 | ||||
-rw-r--r-- | tests/cmdMZ.test | 6 | ||||
-rw-r--r-- | tests/fCmd.test | 55 | ||||
-rw-r--r-- | tests/fileName.test | 577 | ||||
-rw-r--r-- | tests/interp.test | 26 | ||||
-rw-r--r-- | tests/io.test | 12 | ||||
-rw-r--r-- | tests/load.test | 6 | ||||
-rw-r--r-- | tests/macFCmd.test | 200 | ||||
-rw-r--r-- | tests/osa.test | 46 | ||||
-rw-r--r-- | tests/resource.test | 363 | ||||
-rw-r--r-- | tests/socket.test | 10 | ||||
-rw-r--r-- | tests/source.test | 104 |
14 files changed, 20 insertions, 1663 deletions
diff --git a/tests/all.tcl b/tests/all.tcl index db811a7..d8129f7 100644 --- a/tests/all.tcl +++ b/tests/all.tcl @@ -13,10 +13,6 @@ set tcltestVersion [package require tcltest] namespace import -force tcltest::* -if {$tcl_platform(platform) == "macintosh"} { - tcltest::singleProcess 1 -} - tcltest::testsDirectory [file dir [info script]] tcltest::runAllTests diff --git a/tests/binary.test b/tests/binary.test index 122fcdf..d2cbb1f 100644 --- a/tests/binary.test +++ b/tests/binary.test @@ -512,9 +512,6 @@ test binary-14.11 {Tcl_BinaryObjCmd: format} {nonPortable pcOnly} { test binary-14.12 {Tcl_BinaryObjCmd: float overflow} {nonPortable unixOnly} { binary format d NaN } \x7f\xff\xff\xff\xff\xff\xff\xff -test binary-14.13 {Tcl_BinaryObjCmd: float overflow} {nonPortable macOnly} { - binary format d NaN -} \x7f\xf8\x02\xa0\x00\x00\x00\x00 test binary-14.14 {Tcl_BinaryObjCmd: format} { list [catch {binary format d2 {1.6}} msg] $msg } {1 {number of elements in list does not match count}} @@ -1403,10 +1400,6 @@ test binary-40.1 {ScanNumber: floating point overflow} {nonPortable unixOnly} { catch {unset arg1} list [binary scan \xff\xff\xff\xff f1 arg1] $arg1 } {1 -NaN} -test binary-40.2 {ScanNumber: floating point overflow} {nonPortable macOnly} { - catch {unset arg1} - list [binary scan \xff\xff\xff\xff f1 arg1] $arg1 -} {1 -NAN(255)} test binary-40.3 {ScanNumber: floating point overflow} {nonPortable pcOnly} { catch {unset arg1} set result [binary scan \xff\xff\xff\xff f1 arg1] @@ -1421,10 +1414,6 @@ test binary-40.4 {ScanNumber: floating point overflow} {nonPortable unixOnly} { catch {unset arg1} list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1 } {1 -NaN} -test binary-40.5 {ScanNumber: floating point overflow} {nonPortable macOnly} { - catch {unset arg1} - list [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] $arg1 -} {1 -NAN(255)} test binary-40.6 {ScanNumber: floating point overflow} {nonPortable pcOnly} { catch {unset arg1} set result [binary scan \xff\xff\xff\xff\xff\xff\xff\xff d1 arg1] diff --git a/tests/cmdAH.test b/tests/cmdAH.test index eb7d96a..28e396f 100644 --- a/tests/cmdAH.test +++ b/tests/cmdAH.test @@ -238,10 +238,6 @@ test cmdAH-8.3 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname {} } . -test cmdAH-8.4 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - file dirname {} -} : test cmdAH-8.5 {Tcl_FileObjCmd: dirname} { testsetplatform win file dirname {} @@ -250,10 +246,6 @@ test cmdAH-8.6 {Tcl_FileObjCmd: dirname} { testsetplatform unix file dirname .def } . -test cmdAH-8.7 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - file dirname a -} : test cmdAH-8.8 {Tcl_FileObjCmd: dirname} { testsetplatform win file dirname a @@ -330,50 +322,6 @@ test cmdAH-8.26 {Tcl_FileObjCmd: dirname} { testsetplatform windows list [catch {file dirname {//foo/bar}} msg] $msg } {0 //foo/bar} -test cmdAH-8.27 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :} msg] $msg -} {0 :} -test cmdAH-8.28 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :Foo} msg] $msg -} {0 :} -test cmdAH-8.29 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname Foo:} msg] $msg -} {0 Foo:} -test cmdAH-8.30 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname Foo:bar} msg] $msg -} {0 Foo:} -test cmdAH-8.31 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :Foo:bar} msg] $msg -} {0 :Foo} -test cmdAH-8.32 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ::} msg] $msg -} {0 :} -test cmdAH-8.33 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname :::} msg] $msg -} {0 ::} -test cmdAH-8.34 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname /foo/bar/} msg] $msg -} {0 foo:} -test cmdAH-8.35 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname /foo/bar} msg] $msg -} {0 foo:} -test cmdAH-8.36 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname /foo} msg] $msg -} {0 foo:} -test cmdAH-8.37 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname foo} msg] $msg -} {0 :} test cmdAH-8.38 {Tcl_FileObjCmd: dirname} { testsetplatform unix list [catch {file dirname ~/foo} msg] $msg @@ -382,18 +330,6 @@ test cmdAH-8.39 {Tcl_FileObjCmd: dirname} { testsetplatform unix list [catch {file dirname ~bar/foo} msg] $msg } {0 ~bar} -test cmdAH-8.40 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ~bar/foo} msg] $msg -} {0 ~bar:} -test cmdAH-8.41 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ~/foo} msg] $msg -} {0 ~:} -test cmdAH-8.42 {Tcl_FileObjCmd: dirname} { - testsetplatform mac - list [catch {file dirname ~:baz} msg] $msg -} {0 ~:} test cmdAH-8.43 {Tcl_FileObjCmd: dirname} { global env set temp $env(HOME) @@ -421,15 +357,6 @@ test cmdAH-8.45 {Tcl_FileObjCmd: dirname} { set env(HOME) $temp set result } {0 /homewontexist} -test cmdAH-8.46 {Tcl_FileObjCmd: dirname} { - global env - set temp $env(HOME) - set env(HOME) "/home/test" - testsetplatform mac - set result [list [catch {file dirname ~} msg] $msg] - set env(HOME) $temp - set result -} {0 home:} # tail @@ -445,10 +372,6 @@ test cmdAH-9.3 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail {} } {} -test cmdAH-9.4 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail {} -} {} test cmdAH-9.5 {Tcl_FileObjCmd: tail} { testsetplatform win file tail {} @@ -457,10 +380,6 @@ test cmdAH-9.6 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail .def } .def -test cmdAH-9.7 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail a -} a test cmdAH-9.8 {Tcl_FileObjCmd: tail} { testsetplatform win file tail a @@ -537,66 +456,6 @@ test cmdAH-9.26 {Tcl_FileObjCmd: tail} { testsetplatform windows file tail {//foo/bar} } {} -test cmdAH-9.27 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail : -} : -test cmdAH-9.28 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail :Foo -} Foo -test cmdAH-9.29 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail Foo: -} {} -test cmdAH-9.30 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail Foo:bar -} bar -test cmdAH-9.31 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail :Foo:bar -} bar -test cmdAH-9.32 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail :: -} :: -test cmdAH-9.33 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ::: -} :: -test cmdAH-9.34 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail /foo/bar/ -} bar -test cmdAH-9.35 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail /foo/bar -} bar -test cmdAH-9.36 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail /foo -} {} -test cmdAH-9.37 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail foo -} foo -test cmdAH-9.38 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~:foo -} foo -test cmdAH-9.39 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~bar:foo -} foo -test cmdAH-9.40 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~bar/foo -} foo -test cmdAH-9.41 {Tcl_FileObjCmd: tail} { - testsetplatform mac - file tail ~/foo -} foo test cmdAH-9.42 {Tcl_FileObjCmd: tail} { global env set temp $env(HOME) @@ -624,15 +483,6 @@ test cmdAH-9.44 {Tcl_FileObjCmd: tail} { set env(HOME) $temp set result } test -test cmdAH-9.45 {Tcl_FileObjCmd: tail} { - global env - set temp $env(HOME) - set env(HOME) "/home/test" - testsetplatform mac - set result [file tail ~] - set env(HOME) $temp - set result -} test test cmdAH-9.46 {Tcl_FileObjCmd: tail} { testsetplatform unix file tail {f.oo\bar/baz.bat} @@ -700,54 +550,6 @@ test cmdAH-10.10 {Tcl_FileObjCmd: rootname} { testsetplatform unix file rootname a/b.c/ } a/b.c/ -test cmdAH-10.11 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file ro foo -} foo -test cmdAH-10.12 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname {} -} {} -test cmdAH-10.13 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname foo. -} foo -test cmdAH-10.14 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname .foo -} {} -test cmdAH-10.15 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname abc.def -} abc -test cmdAH-10.16 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname abc.def.ghi -} abc.def -test cmdAH-10.17 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a:b:c.d -} a:b:c -test cmdAH-10.18 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a:b.c:d -} a:b.c:d -test cmdAH-10.19 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a/b/c.d -} a/b/c -test cmdAH-10.20 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname a/b.c/d -} a/b.c/d -test cmdAH-10.21 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname /a.b -} /a -test cmdAH-10.22 {Tcl_FileObjCmd: rootname} { - testsetplatform mac - file rootname foo.c: -} foo.c: test cmdAH-10.23 {Tcl_FileObjCmd: rootname} { testsetplatform windows file rootname {} @@ -850,54 +652,6 @@ test cmdAH-11.10 {Tcl_FileObjCmd: extension} { testsetplatform unix file extension a/b.c/ } {} -test cmdAH-11.11 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file ext foo -} {} -test cmdAH-11.12 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension {} -} {} -test cmdAH-11.13 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension foo. -} . -test cmdAH-11.14 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension .foo -} .foo -test cmdAH-11.15 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension abc.def -} .def -test cmdAH-11.16 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension abc.def.ghi -} .ghi -test cmdAH-11.17 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a:b:c.d -} .d -test cmdAH-11.18 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a:b.c:d -} {} -test cmdAH-11.19 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a/b/c.d -} .d -test cmdAH-11.20 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension a/b.c/d -} {} -test cmdAH-11.21 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension /a.b -} .b -test cmdAH-11.22 {Tcl_FileObjCmd: extension} { - testsetplatform mac - file extension foo.c: -} {} test cmdAH-11.23 {Tcl_FileObjCmd: extension} { testsetplatform windows file extension {} @@ -948,7 +702,7 @@ test cmdAH-11.34 {Tcl_FileObjCmd: extension} { } {} set num 35 foreach value {a..b a...b a.c..b ..b} result {.b .b .b .b} { - foreach p {unix mac windows} { + foreach p {unix windows} { ; test cmdAH-7.$num {Tcl_FileObjCmd: extension} " testsetplatform $p file extension $value @@ -1073,13 +827,6 @@ test cmdAH-18.3 {Tcl_FileObjCmd: executable} {unixOnly testchmod} { file exe $gorpfile } 1 -test cmdAH-18.4 {Tcl_FileObjCmd: executable} {macOnly testchmod} { - # On mac, the only executable files are of type APPL. - - set x [file exe $gorpfile] - file attrib $gorpfile -type APPL - lappend x [file exe $gorpfile] -} {0 1} test cmdAH-18.5 {Tcl_FileObjCmd: executable} {winOnly testchmod} { # On pc, must be a .exe, .com, etc. @@ -1134,10 +881,6 @@ test cmdAH-19.7 {Tcl_FileObjCmd: nativename} { testsetplatform windows list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] } {0 {a\b} {}} -test cmdAH-19.8 {Tcl_FileObjCmd: nativename} { - testsetplatform mac - list [catch {file nativename a/b} msg] $msg [testsetplatform $platform] -} {0 :a:b {}} } test cmdAH-19.9 {Tcl_FileObjCmd: ~ : exists} { @@ -1486,10 +1229,6 @@ test cmdAH-26.3 {Tcl_FileObjCmd: readlink errors} {unixOnly nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] \ [string tolower $errorCode] } {1 {could not readlink "_bogus_": no such file or directory} {posix enoent {no such file or directory}}} -test cmdAH-26.4 {Tcl_FileObjCmd: readlink errors} {macOnly nonPortable} { - list [catch {file readlink _bogus_} msg] [string tolower $msg] \ - [string tolower $errorCode] -} {1 {could not readlink "_bogus_": no such file or directory} {posix enoent {no such file or directory}}} test cmdAH-26.5 {Tcl_FileObjCmd: readlink errors} {winOnly nonPortable} { list [catch {file readlink _bogus_} msg] [string tolower $msg] \ [string tolower $errorCode] diff --git a/tests/cmdMZ.test b/tests/cmdMZ.test index b4e91c6..e782715 100644 --- a/tests/cmdMZ.test +++ b/tests/cmdMZ.test @@ -70,12 +70,6 @@ test cmdMZ-2.4 {Tcl_RenameObjCmd: success} { # Tcl_SourceObjCmd -test cmdMZ-3.1 {Tcl_SourceObjCmd: error conditions} {macOnly} { - list [catch {source} msg] $msg -} {1 {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}} -test cmdMZ-3.2 {Tcl_SourceObjCmd: error conditions} {macOnly} { - list [catch {source a b} msg] $msg -} {1 {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?"}} test cmdMZ-3.3 {Tcl_SourceObjCmd: error conditions} {unixOrPc} { list [catch {source} msg] $msg } {1 {wrong # args: should be "source fileName"}} diff --git a/tests/fCmd.test b/tests/fCmd.test index eff2f80..c5ee676 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -86,11 +86,7 @@ proc openup {path} { } proc cleanup {args} { - if {$::tcl_platform(platform) == "macintosh"} { - set wd [list :] - } else { - set wd [list .] - } + set wd [list .] foreach p [concat $wd $args] { set x "" catch { @@ -116,17 +112,6 @@ cd [temporaryDirectory] set ::tcltest::testConstraints(fileSharing) 0 set ::tcltest::testConstraints(notFileSharing) 1 - -if {$tcl_platform(platform) == "macintosh"} { - catch {file delete -force foo.dir} - file mkdir foo.dir - if {[catch {file attributes foo.dir -readonly 1}] == 0} { - set ::tcltest::testConstraints(fileSharing) 1 - set ::tcltest::testConstraints(notFileSharing) 0 - } - file delete -force foo.dir -} - set ::tcltest::testConstraints(xdev) 0 if {$tcl_platform(platform) == "unix"} { @@ -318,10 +303,6 @@ test fCmd-4.11 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} \ testchmod 755 td1/td2 set msg } {1 {can't create directory "td1/td2/td3": permission denied}} -test fCmd-4.12 {TclFileMakeDirsCmd: doesn't exist: errno != ENOENT} {macOnly} { - cleanup - list [catch {file mkdir nonexistentvolume:} msg] $msg -} {1 {can't create directory "nonexistentvolume:": invalid argument}} test fCmd-4.13 {TclFileMakeDirsCmd: doesn't exist: errno == ENOENT} {notRoot} { cleanup set x [file exists td1] @@ -338,9 +319,6 @@ test fCmd-4.14 {TclFileMakeDirsCmd: TclpCreateDirectory fails} \ file delete -force foo set result } {1 {can't create directory "foo/tf1": permission denied}} -test fCmd-4.15 {TclFileMakeDirsCmd: TclpCreateDirectory fails} {macOnly} { - list [catch {file mkdir ${root}:} msg] $msg -} [subst {1 {can't create directory "${root}:": no such file or directory}}] test fCmd-4.16 {TclFileMakeDirsCmd: TclpCreateDirectory succeeds} {notRoot} { cleanup file mkdir tf1 @@ -457,11 +435,6 @@ test fCmd-6.7 {CopyRenameOneFile: errno != ENOENT} {pcOnly 95} { createfile tf1 list [catch {file rename tf1 $long} msg] $msg } [subst {1 {error renaming "tf1" to "$long": file name too long}}] -test fCmd-6.8 {CopyRenameOneFile: errno != ENOENT} {macOnly} { - cleanup - createfile tf1 - list [catch {file rename tf1 $long} msg] $msg -} [subst {1 {error renaming "tf1" to "$long": file name too long}}] test fCmd-6.9 {CopyRenameOneFile: errno == ENOENT} {unixOnly notRoot} { cleanup createfile tf1 @@ -784,20 +757,18 @@ test fCmd-9.8 {file rename: comprehensive: dir to empty dir} {notRoot testchmod file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { testchmod 555 tds3 testchmod 555 tds4 } - if {$tcl_platform(platform) != "macintosh"} { - testchmod 555 [file join tdd2 tds2] - testchmod 555 [file join tdd4 tds4] - } + testchmod 555 [file join tdd2 tds2] + testchmod 555 [file join tdd4 tds4] set msg [list [catch {file rename td1 td2} msg] $msg] file rename -force tds1 tdd1 file rename -force tds2 tdd2 file rename -force tds3 tdd3 file rename -force tds4 tdd4 - if {$tcl_platform(platform) != "unix" && $tcl_platform(platform) != "macintosh"} { + if {$tcl_platform(platform) != "unix"} { set w3 [file writable [file join tdd3 tds3]] set w4 [file writable [file join tdd4 tds4]] } else { @@ -813,12 +784,12 @@ test fCmd-9.9 {file rename: comprehensive: dir to non-empty dir} {notRoot testch file mkdir tds2 file mkdir [file join tdd1 tds1 xxx] file mkdir [file join tdd2 tds2 xxx] - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { testchmod 555 tds2 } set a1 [list [catch {file rename -force tds1 tdd1} msg] $msg] set a2 [list [catch {file rename -force tds2 tdd2} msg] $msg] - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { set w2 [file writable tds2] } else { set w2 0 @@ -841,12 +812,12 @@ test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot te file mkdir td1 file mkdir td2 file mkdir td3 - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { testchmod 555 td2 } file rename td1 [file join td3 td3] file rename td2 [file join td3 td4] - if {!([testConstraint unix] || [testConstraint winVista]) && $tcl_platform(platform) != "macintosh"} { + if {!([testConstraint unix] || [testConstraint winVista])} { set w4 [file writable [file join td3 td4]] } else { set w4 0 @@ -857,16 +828,12 @@ test fCmd-9.11 {file rename: comprehensive: dir to new name and dir} {notRoot te test fCmd-9.12 {file rename: comprehensive: target exists} {notRoot testchmod notNetworkFilesystem} { cleanup file mkdir [file join td1 td2] [file join td2 td1] - if {$tcl_platform(platform) != "macintosh"} { testchmod 555 [file join td2 td1] - } file mkdir [file join td3 td4] [file join td4 td3] file rename -force td3 td4 set msg [list [file exists td3] [file exists [file join td4 td3 td4]] \ [catch {file rename td1 td2} msg] $msg] - if {$tcl_platform(platform) != "macintosh"} { testchmod 755 [file join td2 td1] - } set msg } [subst {0 1 1 {error renaming "td1" to "[file join td2 td1]": file already exists}}] test fCmd-9.13 {file rename: comprehensive: can't overwrite target} {notRoot} { @@ -916,10 +883,8 @@ test fCmd-10.3 {file copy: comprehensive: dir to new name} {notRoot unixOrPc 95o file copy td2 td4 set msg [list [lsort [glob td*]] [glob -directory td3 t*] \ [glob -directory td4 t*] [file writable td3] [file writable td4]] - if {$tcl_platform(platform) != "macintosh"} { testchmod 755 td2 testchmod 755 td4 - } set msg } [subst {{td1 td2 td3 td4} [file join td3 tdx] [file join td4 tdy] 1 0}] test fCmd-10.3.1 {file copy: comprehensive: dir to new name} {notRoot pc 2000orNewer testchmod} { @@ -971,12 +936,10 @@ test fCmd-10.5 {file copy: comprehensive: dir to empty dir} {notRoot testchmod} file mkdir [file join tdd2 tds2] file mkdir [file join tdd3 tds3] file mkdir [file join tdd4 tds4] - if {$tcl_platform(platform) != "macintosh"} { testchmod 555 tds3 testchmod 555 tds4 testchmod 555 [file join tdd2 tds2] testchmod 555 [file join tdd4 tds4] - } set a1 [list [catch {file copy td1 td2} msg] $msg] set a2 [list [catch {file copy -force tds1 tdd1} msg] $msg] set a3 [catch {file copy -force tds2 tdd2}] diff --git a/tests/fileName.test b/tests/fileName.test index 6c80826..6eabc76 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -56,115 +56,6 @@ test filename-1.8 {Tcl_GetPathType: unix} {testsetplatform} { file pathtype ./~foo } relative -test filename-2.1 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype / -} relative -test filename-2.2 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype /. -} relative -test filename-2.3 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype /.. -} relative -test filename-2.4 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype //.// -} relative -test filename-2.5 {Tcl_GetPathType: mac, denerate names} {testsetplatform} { - testsetplatform mac - file pathtype //.//../. -} relative -test filename-2.6 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~ -} absolute -test filename-2.7 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~: -} absolute -test filename-2.8 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~:foo -} absolute -test filename-2.9 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~/ -} absolute -test filename-2.10 {Tcl_GetPathType: mac, tilde names} {testsetplatform} { - testsetplatform mac - file pathtype ~/foo -} absolute -test filename-2.11 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /foo -} absolute -test filename-2.12 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /./foo -} absolute -test filename-2.13 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /..//./foo -} absolute -test filename-2.14 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype /foo/bar -} absolute -test filename-2.15 {Tcl_GetPathType: mac, unix-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo/bar -} relative -test filename-2.16 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype : -} relative -test filename-2.17 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype :foo -} relative -test filename-2.18 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo: -} absolute -test filename-2.19 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo:bar -} absolute -test filename-2.20 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype :foo:bar -} relative -test filename-2.21 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype ::foo:bar -} relative -test filename-2.22 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype ~foo -} absolute -test filename-2.23 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype :~foo -} relative -test filename-2.24 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype ~foo: -} absolute -test filename-2.25 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo/bar: -} absolute -test filename-2.26 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype /foo: -} absolute -test filename-2.27 {Tcl_GetPathType: mac, mac-style names} {testsetplatform} { - testsetplatform mac - file pathtype foo -} relative - test filename-3.1 {Tcl_GetPathType: windows} {testsetplatform} { testsetplatform windows file pathtype / @@ -333,211 +224,6 @@ test filename-4.19 {Tcl_SplitPath} { list $res $err } {0 tildetmp/~tilde} -test filename-5.1 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b -} {a: b} -test filename-5.2 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b:c -} {a: b c} -test filename-5.3 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b:c: -} {a: b c} -test filename-5.4 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a: -} {a:} -test filename-5.5 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:: -} {a: ::} -test filename-5.6 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a::: -} {a: :: ::} -test filename-5.7 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split :a -} {a} -test filename-5.8 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split :a:: -} {a ::} -test filename-5.9 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split : -} {:} -test filename-5.10 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split :: -} {::} -test filename-5.11 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ::: -} {:: ::} -test filename-5.12 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:::b -} {a: :: :: b} -test filename-5.13 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /a:b -} {/a: b} -test filename-5.14 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~: -} {~:} -test filename-5.15 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~/: -} {~/:} -test filename-5.16 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~:foo -} {~: foo} -test filename-5.17 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~/foo -} {~: foo} -test filename-5.18 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo: -} {~foo:} -test filename-5.19 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:~foo -} {a: :~foo} -test filename-5.20 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split / -} {:/} -test filename-5.21 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a:b/c -} {a: :b/c} -test filename-5.22 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /foo -} {foo:} -test filename-5.23 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /a/b -} {a: b} -test filename-5.24 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /a/b/foo -} {a: b foo} -test filename-5.25 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/b -} {a b} -test filename-5.26 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ./foo/bar -} {: foo bar} -test filename-5.27 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ../foo/bar -} {:: foo bar} -test filename-5.28 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split {} -} {} -test filename-5.29 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split . -} {:} -test filename-5.30 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ././ -} {: :} -test filename-5.31 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ././. -} {: : :} -test filename-5.32 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ../ -} {::} -test filename-5.33 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split .. -} {::} -test filename-5.34 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ../.. -} {:: ::} -test filename-5.35 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split //foo -} {foo:} -test filename-5.36 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split foo//bar -} {foo bar} -test filename-5.37 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo -} {~foo:} -test filename-5.38 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~ -} {~:} -test filename-5.39 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split foo -} {foo} -test filename-5.40 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~/ -} {~:} -test filename-5.41 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo/~bar -} {~foo: :~bar} -test filename-5.42 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split ~foo/~bar/~baz -} {~foo: :~bar :~baz} -test filename-5.43 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split foo/bar~/baz -} {foo bar~ baz} -test filename-5.44 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/../b -} {a :: b} -test filename-5.45 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/../../b -} {a :: :: b} -test filename-5.46 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split a/.././../b -} {a :: : :: b} -test filename-5.47 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /../bar -} {bar:} -test filename-5.48 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /./bar -} {bar:} -test filename-5.49 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split //.//.././bar -} {bar:} -test filename-5.50 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split /.. -} {:/..} -test filename-5.51 {Tcl_SplitPath: mac} {testsetplatform} { - testsetplatform mac - file split //.//.././ -} {://.//.././} - test filename-6.1 {Tcl_SplitPath: win} {testsetplatform} { testsetplatform win file split / @@ -732,95 +418,6 @@ test filename-7.18 {Tcl_JoinPath: unix} {testsetplatform} { file join /// a b } {/a/b} -test filename-8.1 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a b -} {:a:b} -test filename-8.2 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join :a b -} {:a:b} -test filename-8.3 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a b: -} {b:} -test filename-8.4 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :b -} {a:b} -test filename-8.5 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :b: -} {a:b} -test filename-8.6 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a :: b -} {:a::b} -test filename-8.7 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a :: :: b -} {:a:::b} -test filename-8.8 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a ::: b -} {:a:::b} -test filename-8.9 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: b: -} {b:} -test filename-8.10 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join /a/b -} {a:b} -test filename-8.11 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join /a/b c/d -} {a:b:c:d} -test filename-8.12 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join /a/b :c:d -} {a:b:c:d} -test filename-8.13 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join ~ foo -} {~:foo} -test filename-8.14 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join :: :: -} {:::} -test filename-8.15 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :: -} {a::} -test filename-8.16 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a {} b -} {:a:b} -test filename-8.17 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a::: b -} {a:::b} -test filename-8.18 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a : : : -} {:a} -test filename-8.19 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join : -} {:} -test filename-8.20 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join : a -} {:a} -test filename-8.21 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join a: :b/c -} {a:b/c} -test filename-8.22 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - file join :a :b/c -} {:a:b/c} - test filename-9.1 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win file join a b @@ -926,22 +523,6 @@ test filename-9.20 {Tcl_JoinPath: unix} {testsetplatform} { [file join /x {/foo/bar}] \ [file join /x /x {/foo/bar}] } {/foo/bar /foo/bar /foo/bar} -test filename-9.21 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {/foo/bar}] \ - [file join drive: {/foo/bar}] \ - [file join drive: drive: {/foo/bar}] -} {foo:bar foo:bar foo:bar} -test filename-9.22 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {foo:bar}] \ - [file join drive: {foo:bar}] \ - [file join drive: drive: {foo:bar}] -} {foo:bar foo:bar foo:bar} test filename-9.23 {Tcl_JoinPath: win} {testsetplatform} { testsetplatform win set res {} @@ -960,24 +541,6 @@ test filename-9.24 {Tcl_JoinPath: unix} {testsetplatform} { [file join /x /x {foo/bar}] string map [list /x ""] $res } {foo/bar /foo/bar /foo/bar} -test filename-9.25 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {foo/bar}] \ - [file join drive: {foo/bar}] \ - [file join drive: drive: {foo/bar}] - string map [list drive: ""] $res -} {:foo:bar foo:bar foo:bar} -test filename-9.26 {Tcl_JoinPath: mac} {testsetplatform} { - testsetplatform mac - set res {} - lappend res \ - [file join {:foo:bar}] \ - [file join drive: {:foo:bar}] \ - [file join drive: drive: {:foo:bar}] - string map [list drive: ""] $res -} {:foo:bar foo:bar foo:bar} test filename-10.1 {Tcl_TranslateFileName} {testsetplatform} { testsetplatform unix @@ -991,14 +554,6 @@ test filename-10.3 {Tcl_TranslateFileName} {testsetplatform} { testsetplatform windows list [catch {testtranslatefilename {c:/\\foo/}} msg] $msg } {0 {c:\foo}} -test filename-10.4 {Tcl_TranslateFileName} {testsetplatform} { - testsetplatform mac - list [catch {testtranslatefilename foo} msg] $msg -} {0 :foo} -test filename-10.5 {Tcl_TranslateFileName} {testsetplatform} { - testsetplatform mac - list [catch {testtranslatefilename :~foo} msg] $msg -} {0 :~foo} test filename-10.6 {Tcl_TranslateFileName} {testsetplatform} { global env set temp $env(HOME) @@ -1044,60 +599,6 @@ test filename-10.10 {Tcl_TranslateFileName} {testsetplatform} { set env(HOME) $temp set result } {0 /home/test/foo} -test filename-10.11 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:" - testsetplatform mac - set result [list [catch {testtranslatefilename ~/foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:foo} -test filename-10.12 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home" - testsetplatform mac - set result [list [catch {testtranslatefilename ~/foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home:foo} -test filename-10.13 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home" - testsetplatform mac - set result [list [catch {testtranslatefilename ~::foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home::foo} -test filename-10.14 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home" - testsetplatform mac - set result [list [catch {testtranslatefilename ~} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home} -test filename-10.15 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home:" - testsetplatform mac - set result [list [catch {testtranslatefilename ~::foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home::foo} -test filename-10.16 {Tcl_TranslateFileName} {testsetplatform} { - global env - set temp $env(HOME) - set env(HOME) "Root:home::" - testsetplatform mac - set result [list [catch {testtranslatefilename ~::foo} msg] $msg] - set env(HOME) $temp - set result -} {0 Root:home:::foo} test filename-10.17 {Tcl_TranslateFileName} {testsetplatform} { global env set temp $env(HOME) @@ -1249,7 +750,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 macOnly} { +test filename-11.17.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -directory $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1379,7 +880,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 macOnly} { +test filename-11.18.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1397,7 +898,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 macOnly} { +test filename-11.19.1 {Tcl_GlobCmd} {pcOnly} { 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]\ @@ -1439,7 +940,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 macOnly} { +test filename-11.22.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -dir $globname *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1456,7 +957,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 macOnly} { +test filename-11.23.1 {Tcl_GlobCmd} {pcOnly} { list [catch {lsort [glob -path $globname/ *]} msg] $msg } [list 0 [lsort [list [file join $globname a1] [file join $globname a2]\ [file join $globname .1]\ @@ -1474,7 +975,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 macOnly} { +test filename-11.24.1 {Tcl_GlobCmd} {pcOnly} { 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]\ @@ -1614,27 +1115,11 @@ test filename-12.1.5 {simple globbing} {pcOnly} { test filename-12.1.6 {simple globbing} {pcOnly} { list [catch {glob c:/} msg] $msg } {0 c:/} -test filename-12.2 {simple globbing} {macOnly} { - list [catch {glob {}} msg] $msg -} {0 :} -test filename-12.2.1 {simple globbing} {macOnly} { - list [catch {glob -types f {}} msg] $msg -} {1 {no files matched glob pattern ""}} -test filename-12.2.2 {simple globbing} {macOnly} { - list [catch {glob -types d {}} msg] $msg -} {0 :} -test filename-12.2.3 {simple globbing} {macOnly} { - list [catch {glob -types hidden {}} msg] $msg -} {1 {no files matched glob pattern ""}} test filename-12.3 {simple globbing} { list [catch {glob -nocomplain \{a1,a2\}} msg] $msg } {0 {}} -if {$tcl_platform(platform) == "macintosh"} { - set globPreResult :globTest: -} else { set globPreResult globTest/ -} set x1 x1.c set y1 y1.c test filename-12.4 {simple globbing} {unixOrPc} { @@ -1713,36 +1198,21 @@ test filename-13.10 {globbing with brace substitution} { test filename-13.11 {globbing with brace substitution} {unixOrPc} { list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg } {0 {globTest/x1.c globTest/x,z1.c globTest/z1.c}} -test filename-13.12 {globbing with brace substitution} {macOnly} { - list [lsort [catch {glob globTest/\{x,x\\,z,z\}1.c} msg]] $msg -} {0 {:globTest:x1.c :globTest:x,z1.c :globTest:z1.c}} test filename-13.13 {globbing with brace substitution} { lsort [glob globTest/{a,b,x,y}1.c] } [list $globPreResult$x1 $globPreResult$y1] test filename-13.14 {globbing with brace substitution} {unixOrPc} { lsort [glob {globTest/{x1,y2,weird name}.c}] } {{globTest/weird name.c} globTest/x1.c} -test filename-13.15 {globbing with brace substitution} {macOnly} { - lsort [glob {globTest/{x1,y2,weird name}.c}] -} {{:globTest:weird name.c} :globTest:x1.c} test filename-13.16 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{x1.c,a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} -test filename-13.17 {globbing with brace substitution} {macOnly} { - lsort [glob globTest/{x1.c,a1/*}] -} {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c} test filename-13.18 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{x1.c,{a},a1/*}] } {globTest/a1/b1 globTest/a1/b2 globTest/x1.c} -test filename-13.19 {globbing with brace substitution} {macOnly} { - lsort [glob globTest/{x1.c,{a},a1/*}] -} {:globTest:a1:b1 :globTest:a1:b2 :globTest:x1.c} test filename-13.20 {globbing with brace substitution} {unixOrPc} { lsort [glob globTest/{a,x}1/*/{x,y}*] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} -test filename-13.21 {globbing with brace substitution} {macOnly} { - lsort [glob globTest/{a,x}1/*/{x,y}*] -} {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c} test filename-13.22 {globbing with brace substitution} { list [catch {glob globTest/\{a,x\}1/*/\{} msg] $msg } {1 {unmatched open-brace in file name}} @@ -1750,15 +1220,9 @@ test filename-13.22 {globbing with brace substitution} { test filename-14.1 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob glo*/*.c] } {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.2 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob glo*/*.c] -} {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c} test filename-14.3 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/?1.c] } {globTest/x1.c globTest/y1.c globTest/z1.c} -test filename-14.4 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/?1.c] -} {:globTest:x1.c :globTest:y1.c :globTest:z1.c} # The current directory could be anywhere; do this to stop spurious matches file mkdir globTestContext @@ -1769,9 +1233,6 @@ cd globTestContext test filename-14.5 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob */*/*/*.c] } {globTest/a1/b1/x2.c globTest/a1/b2/y2.c} -test filename-14.6 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob */*/*/*.c] -} {:globTest:a1:b1:x2.c :globTest:a1:b2:y2.c} # Reset to where we were cd $savepwd @@ -1784,33 +1245,18 @@ test filename-14.7 {asterisks, question marks, and brackets} {unixOnly} { test filename-14.7.1 {asterisks, question marks, and brackets} {pcOnly} { 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.8 {asterisks, question marks, and brackets} {macOnly} { - 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} { lsort [glob globTest/.*] } {globTest/. globTest/.. globTest/.1} -test filename-14.10 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/.*] -} {:globTest:.1} test filename-14.11 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/*/*] } {globTest/a1/b1 globTest/a1/b2 globTest/a2/b3} -test filename-14.12 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/*/*] -} {:globTest:a1:b1 :globTest:a1:b2 :globTest:a2:b3} test filename-14.13 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob {globTest/[xyab]1.*}] } {globTest/x1.c globTest/y1.c} -test filename-14.14 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob {globTest/[xyab]1.*}] -} {:globTest:x1.c :globTest:y1.c} test filename-14.15 {asterisks, question marks, and brackets} {unixOrPc} { lsort [glob globTest/*/] } {globTest/a1/ globTest/a2/ globTest/a3/} -test filename-14.16 {asterisks, question marks, and brackets} {macOnly} { - lsort [glob globTest/*/] -} {:globTest:a1: :globTest:a2: :globTest:a3:} test filename-14.17 {asterisks, question marks, and brackets} { global env set temp $env(HOME) @@ -1822,9 +1268,6 @@ test filename-14.17 {asterisks, question marks, and brackets} { test filename-14.18 {asterisks, question marks, and brackets} {unixOrPc} { list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg } {0 {{globTest/weird name.c} globTest/x,z1.c globTest/x1.c globTest/y1.c globTest/z1.c}} -test filename-14.19 {asterisks, question marks, and brackets} {macOnly} { - list [catch {lsort [glob globTest/*.c goo/*]} msg] $msg -} {0 {{:globTest:weird name.c} :globTest:x,z1.c :globTest:x1.c :globTest:y1.c :globTest:z1.c}} test filename-14.20 {asterisks, question marks, and brackets} { list [catch {glob -nocomplain goo/*} msg] $msg } {0 {}} @@ -1847,14 +1290,6 @@ test filename-14.25 {type specific globbing} {unixOnly} { [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 macOnly} { - list [catch {lsort [glob -dir globTest -types f *]} msg] $msg -} [list 0 [lsort [list \ - [file join $globname .1]\ - [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.26 {type specific globbing} { list [catch {glob -nocomplain -dir globTest -types {readonly} *} msg] $msg } [list 0 {}] diff --git a/tests/interp.test b/tests/interp.test index ff38301..8580446 100644 --- a/tests/interp.test +++ b/tests/interp.test @@ -15,13 +15,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} { namespace import -force ::tcltest::* } -# The set of hidden commands is platform dependent: - -if {"$tcl_platform(platform)" == "macintosh"} { - set hidden_cmds {beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} -} else { - set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source} -} +set hidden_cmds {cd encoding exec exit fconfigure file glob load open pwd socket source} foreach i [interp slaves] { interp delete $i @@ -1742,24 +1736,6 @@ test interp-23.2 {testing hiding vs aliases} {unixOrPc} { set l } {{cd encoding exec exit fconfigure file glob load open pwd socket source} bar {cd encoding exec exit fconfigure file glob load open pwd socket source} bar {bar cd encoding exec exit fconfigure file glob load open pwd socket source} {} {cd encoding exec exit fconfigure file glob load open pwd socket source}} -test interp-23.3 {testing hiding vs aliases} {macOnly} { - catch {interp delete a} - interp create a -safe - set l "" - lappend l [lsort [interp hidden a]] - a alias bar bar - lappend l [interp aliases a] - lappend l [lsort [interp hidden a]] - a hide bar - lappend l [interp aliases a] - lappend l [lsort [interp hidden a]] - a alias bar {} - lappend l [interp aliases a] - lappend l [lsort [interp hidden a]] - interp delete a - set l -} {{beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} bar {beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} bar {bar beep cd echo encoding exit fconfigure file glob load ls open pwd socket source} {} {beep cd echo encoding exit fconfigure file glob load ls open pwd socket source}} - test interp-24.1 {result resetting on error} { catch {interp delete a} interp create a diff --git a/tests/io.test b/tests/io.test index ed2619a..718ce7e 100644 --- a/tests/io.test +++ b/tests/io.test @@ -1609,11 +1609,7 @@ test io-13.12 {TranslateInputEOL: find EOF char in src} { # also testing channel table management. if {[info commands testchannel] != ""} { - if {$tcl_platform(platform) == "macintosh"} { - set consoleFileNames [list console0 console1 console2] - } else { - set consoleFileNames [lsort [testchannel open]] - } + set consoleFileNames [lsort [testchannel open]] } else { # just to avoid an error set consoleFileNames [list] @@ -1936,12 +1932,6 @@ test io-20.3 {Tcl_CreateChannel: initial settings} {unixOnly} { close $f set x } {{{} {}} {auto lf}} -test io-20.4 {Tcl_CreateChannel: initial settings} {macOnly} { - set f [open $path(test1) w+] - set x [list [fconfigure $f -eofchar] [fconfigure $f -translation]] - close $f - set x -} {{{} {}} {auto cr}} set path(stdout) [makeFile {} stdout] diff --git a/tests/load.test b/tests/load.test index 4794bd1..963516e 100644 --- a/tests/load.test +++ b/tests/load.test @@ -18,12 +18,6 @@ if {[lsearch [namespace children] ::tcltest] == -1} { # Figure out what extension is used for shared libraries on this # platform. -if {$tcl_platform(platform) == "macintosh"} { - puts "can't run dynamic library tests on macintosh machines" - ::tcltest::cleanupTests - return -} - # Tests require the existence of one of the DLLs in the dltest directory. set ext [info sharedlibextension] set testDir [file join [file dirname [info nameofexecutable]] dltest] diff --git a/tests/macFCmd.test b/tests/macFCmd.test deleted file mode 100644 index c35b793..0000000 --- a/tests/macFCmd.test +++ /dev/null @@ -1,200 +0,0 @@ -# This file tests the tclfCmd.c file. -# -# This file contains a collection of tests for one or more of the Tcl -# built-in commands. Sourcing this file into Tcl runs the tests and -# generates output for errors. No output means no errors were found. -# -# Copyright (c) 1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest - namespace import -force ::tcltest::* -} - -# These tests really need to be run from a writable directory, which -# it is assumed [temporaryDirectory] is. -set oldcwd [pwd] -cd [temporaryDirectory] - -catch {file delete -force foo.dir} -file mkdir foo.dir -if {[catch {file attributes foo.dir -readonly 1}]} { - set ::tcltest::testConstraints(fileSharing) 0 - set ::tcltest::testConstraints(notFileSharing) 1 -} else { - set ::tcltest::testConstraints(fileSharing) 1 - set ::tcltest::testConstraints(notFileSharing) 0 -} -file delete -force foo.dir - -test macFCmd-1.1 {GetFileFinderAttributes - no file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -creator} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-1.2 {GetFileFinderAttributes - creator} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - list [catch {file attributes foo.file -creator} msg] \ - [regexp {MPW |CWIE} $msg] [file delete -force foo.file] -} {0 1 {}} -test macFCmd-1.3 {GetFileFinderAttributes - type} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - list [catch {file attributes foo.file -type} msg] $msg \ - [file delete -force foo.file] -} {0 TEXT {}} -test macFCmd-1.4 {GetFileFinderAttributes - not hidden} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - list [catch {file attributes foo.file -hidden} msg] $msg \ - [file delete -force foo.file] -} {0 0 {}} -test macFCmd-1.5 {GetFileFinderAttributes - hidden} {macOnly} { - catch {file delete -force foo.file} - catch {close [open foo.file w]} - file attributes foo.file -hidden 1 - list [catch {file attributes foo.file -hidden} msg] $msg \ - [file delete -force foo.file] -} {0 1 {}} -test macFCmd-1.6 {GetFileFinderAttributes - folder creator} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -creator} msg] $msg \ - [file delete -force foo.dir] -} {0 Fldr {}} -test macFCmd-1.7 {GetFileFinderAttributes - folder type} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -type} msg] $msg \ - [file delete -force foo.dir] -} {0 Fldr {}} -test macFCmd-1.8 {GetFileFinderAttributes - folder hidden} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -hidden} msg] $msg \ - [file delete -force foo.dir] -} {0 0 {}} - -test macFCmd-2.1 {GetFileReadOnly - bad file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -readonly} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-2.2 {GetFileReadOnly - file not read only} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -readonly} msg] $msg \ - [file delete -force foo.file] -} {0 0 {}} -test macFCmd-2.3 {GetFileReadOnly - file read only} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - file attributes foo.file -readonly 1 - list [catch {file attributes foo.file -readonly} msg] $msg \ - [file delete -force foo.file] -} {0 1 {}} -test macFCmd-2.4 {GetFileReadOnly - directory not read only} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly} msg] $msg \ - [file delete -force foo.dir] -} {0 0 {}} -test macFCmd-2.5 {GetFileReadOnly - directory read only} {macOnly fileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - file attributes foo.dir -readonly 1 - list [catch {file attributes foo.dir -readonly} msg] $msg \ - [file delete -force foo.dir] -} {0 1 {}} - -test macFCmd-3.1 {SetFileFinderAttributes - bad file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -creator FOOO} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-3.2 {SetFileFinderAttributes - creator} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -creator FOOO} msg] $msg \ - [file attributes foo.file -creator] [file delete -force foo.file] -} {0 {} FOOO {}} -test macFCmd-3.3 {SetFileFinderAttributes - bad creator} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -creator 0} msg] $msg \ - [file delete -force foo.file] -} {1 {expected Macintosh OS type but got "0"} {}} -test macFCmd-3.4 {SetFileFinderAttributes - hidden} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -hidden 1} msg] $msg \ - [file attributes foo.file -hidden] [file delete -force foo.file] -} {0 {} 1 {}} -test macFCmd-3.5 {SetFileFinderAttributes - type} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -type FOOO} msg] $msg \ - [file attributes foo.file -type] [file delete -force foo.file] -} {0 {} FOOO {}} -test macFCmd-3.6 {SetFileFinderAttributes - bad type} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -type 0} msg] $msg \ - [file delete -force foo.file] -} {1 {expected Macintosh OS type but got "0"} {}} -test macFCmd-3.7 {SetFileFinderAttributes - directory} {macOnly} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -creator FOOO} msg] \ - $msg [file delete -force foo.dir] -} {1 {cannot set -creator: "foo.dir" is a directory} {}} - -test macFCmd-4.1 {SetFileReadOnly - bad file} {macOnly} { - catch {file delete -force foo.file} - list [catch {file attributes foo.file -readonly 1} msg] $msg -} {1 {could not read "foo.file": no such file or directory}} -test macFCmd-4.2 {SetFileReadOnly - file not readonly} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -readonly 0} msg] \ - $msg [file attributes foo.file -readonly] [file delete -force foo.file] -} {0 {} 0 {}} -test macFCmd-4.3 {SetFileReadOnly - file readonly} {macOnly} { - catch {file delete -force foo.file} - close [open foo.file w] - list [catch {file attributes foo.file -readonly 1} msg] \ - $msg [file attributes foo.file -readonly] [file delete -force foo.file] -} {0 {} 1 {}} -test macFCmd-4.4 {SetFileReadOnly - directory not readonly} \ - {macOnly fileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 0} msg] \ - $msg [file attributes foo.dir -readonly] [file delete -force foo.dir] -} {0 {} 0 {}} -test macFCmd-4.5 {SetFileReadOnly - directory not readonly} \ - {macOnly notFileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 0} msg] $msg \ - [file delete -force foo.dir] -} {1 {cannot set a directory to read-only when File Sharing is turned off} {}} -test macFCmd-4.6 {SetFileReadOnly - directory readonly} {macOnly fileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 1} msg] $msg \ - [file attributes foo.dir -readonly] [file delete -force foo.dir] -} {0 {} 1 {}} -test macFCmd-4.7 {SetFileReadOnly - directory readonly} {macOnly notFileSharing} { - catch {file delete -force foo.dir} - file mkdir foo.dir - list [catch {file attributes foo.dir -readonly 1} msg] $msg \ - [file delete -force foo.dir] -} {1 {cannot set a directory to read-only when File Sharing is turned off} {}} - -# cleanup -cd $oldcwd -::tcltest::cleanupTests -return diff --git a/tests/osa.test b/tests/osa.test deleted file mode 100644 index 0fc722c..0000000 --- a/tests/osa.test +++ /dev/null @@ -1,46 +0,0 @@ -# Commands covered: AppleScript -# -# This file contains a collection of tests for one or more of the Tcl -# built-in commands. Sourcing this file into Tcl runs the tests and -# generates output for errors. No output means no errors were found. -# -# Copyright (c) 1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest - namespace import -force ::tcltest::* -} - -# Only run the test if we can load the AppleScript command -set ::tcltest::testConstraints(appleScript) [expr {[info commands AppleScript] != ""}] - -test osa-1.1 {Tcl_OSAComponentCmd} {macOnly appleScript} { - list [catch AppleScript msg] $msg -} {1 {wrong # args: should be "AppleScript option ?arg ...?"}} -test osa-1.2 {Tcl_OSAComponentCmd} {macOnly appleScript} { - list [catch {AppleScript x} msg] $msg -} {1 {bad option "x": should be compile, decompile, delete, execute, info, load, run or store}} - -test osa-1.3 {TclOSACompileCmd} {macOnly appleScript} { - list [catch {AppleScript compile} msg] $msg -} {1 {wrong # args: should be "AppleScript compile ?options? code"}} - -# cleanup -::tcltest::cleanupTests -return - - - - - - - - - - - - diff --git a/tests/resource.test b/tests/resource.test deleted file mode 100644 index 3ae24e2..0000000 --- a/tests/resource.test +++ /dev/null @@ -1,363 +0,0 @@ -# Commands covered: resource -# -# This file contains a collection of tests for one or more of the Tcl -# built-in commands. Sourcing this file into Tcl runs the tests and -# generates output for errors. No output means no errors were found. -# -# Copyright (c) 1996-1997 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# -# See the file "license.terms" for information on usage and redistribution -# of this file, and for a DISCLAIMER OF ALL WARRANTIES. - -if {[lsearch [namespace children] ::tcltest] == -1} { - package require tcltest - namespace import -force ::tcltest::* -} - -test resource-1.1 {resource tests} {macOnly} { - list [catch {resource} msg] $msg -} {1 {wrong # args: should be "resource option ?arg ...?"}} -test resource-1.2 {resource tests} {macOnly} { - list [catch {resource _bad_} msg] $msg -} {1 {bad option "_bad_": must be close, delete, files, list, open, read, types, or write}} - -# resource open & close tests -test resource-2.1 {resource open & close tests} {macOnly} { - list [catch {resource open} msg] $msg -} {1 {wrong # args: should be "resource open fileName ?permissions?"}} -test resource-2.2 {resource open & close tests} {macOnly} { - list [catch {resource open resource.test r extraArg} msg] $msg -} {1 {wrong # args: should be "resource open fileName ?permissions?"}} -test resource-2.3 {resource open & close tests} {macOnly} { - list [catch {resource open resource.test bad_perms} msg] $msg -} {1 {illegal access mode "bad_perms"}} -test resource-2.4 {resource open & close tests} {macOnly} { - list [catch {resource open _bad_file_} msg] $msg -} {1 {file does not exist}} -test resource-2.5 {resource open & close tests} {macOnly} { - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file] - resource close $id - file delete rsrc.file -} {} -test resource-2.6 {resource open & close tests} {macOnly} { - catch {file delete rsrc.file} - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {A test string} - set id [resource open rsrc.file] - set result [string compare [resource open rsrc.file] $id] - lappend result [resource read TEXT fileRsrcName $id] - resource close $id - file delete rsrc.file - set result -} {0 {A test string}} -test resource-2.7 {resource open & close tests} {macOnly} { - catch {file delete rsrc.file} - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file r] - set result [catch {resource open rsrc.file w} mssg] - resource close $id - file delete rsrc.file - lappend result $mssg - set result -} {1 {Resource already open with different permissions.}} -test resource-2.8 {resource open & close tests} {macOnly} { - list [catch {resource close} msg] $msg -} {1 {wrong # args: should be "resource close resourceRef"}} -test resource-2.9 {resource open & close tests} {macOnly} { - list [catch {resource close foo bar} msg] $msg -} {1 {wrong # args: should be "resource close resourceRef"}} -test resource-2.10 {resource open & close tests} {macOnly} { - list [catch {resource close _bad_resource_} msg] $msg -} {1 {invalid resource file reference "_bad_resource_"}} -test resource-2.11 {resource open & close tests} {macOnly} { - set result [catch {resource close System} mssg] - lappend result $mssg -} {1 {can't close "System" resource file}} -test resource-2.12 {resource open & close tests} {macOnly} { - set result [catch {resource close application} mssg] - lappend result $mssg -} {1 {can't close "application" resource file}} - -# Tests for listing resources -test resource-3.1 {resource list tests} {macOnly} { - list [catch {resource list} msg] $msg -} {1 {wrong # args: should be "resource list resourceType ?resourceRef?"}} -test resource-3.2 {resource list tests} {macOnly} { - list [catch {resource list _bad_type_} msg] $msg -} {1 {expected Macintosh OS type but got "_bad_type_"}} -test resource-3.3 {resource list tests} {macOnly} { - list [catch {resource list TEXT _bad_ref_} msg] $msg -} {1 {invalid resource file reference "_bad_ref_"}} -test resource-3.4 {resource list tests} {macOnly} { - list [catch {resource list TEXT _bad_ref_ extraArg} msg] $msg -} {1 {wrong # args: should be "resource list resourceType ?resourceRef?"}} -test resource-3.5 {resource list tests} {macOnly} { - catch {file delete rsrc.file} - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file] - catch "resource list TEXT $id" result - resource close $id - set result -} {fileRsrcName} -test resource-3.6 {resource list tests} {macOnly} { - # There should not be any resource of this type - resource list XXXX -} {} -test resource-3.7 {resource list tests} {macOnly} { - set resourceList [resource list STR#] - if {[lsearch $resourceList {Tcl Environment Variables}] == -1} { - set result {couldn't find resource that should exist} - } else { - set result ok - } -} {ok} - -# Tests for reading resources -test resource-4.1 {resource read tests} {macOnly} { - list [catch {resource read} msg] $msg -} {1 {wrong # args: should be "resource read resourceType resourceId ?resourceRef?"}} -test resource-4.2 {resource read tests} {macOnly} { - list [catch {resource read TEXT} msg] $msg -} {1 {wrong # args: should be "resource read resourceType resourceId ?resourceRef?"}} -test resource-4.3 {resource read tests} {macOnly} { - list [catch {resource read STR# {_non_existant_resource_}} msg] $msg -} {1 {could not load resource}} -test resource-4.4 {resource read tests} {macOnly} { - # The following resource should exist and load OK without error - catch {resource read STR# {Tcl Environment Variables}} -} {0} - -# Tests for getting resource types -test resource-5.1 {resource types tests} {macOnly} { - list [catch {resource types _bad_ref_} msg] $msg -} {1 {invalid resource file reference "_bad_ref_"}} -test resource-5.2 {resource types tests} {macOnly} { - list [catch {resource types _bad_ref_ extraArg} msg] $msg -} {1 {wrong # args: should be "resource types ?resourceRef?"}} -test resource-5.3 {resource types tests} {macOnly} { - # This should never cause an error - catch {resource types} -} {0} -test resource-5.4 {resource types tests} {macOnly} { - testWriteTextResource -rsrc fileRsrcName -file rsrc.file {error "don't source me"} - set id [resource open rsrc.file] - set result [resource types $id] - resource close $id - set result -} {TEXT} - -# resource write tests -test resource-6.1 {resource write tests} {macOnly} { - list [catch {resource write} msg] $msg -} {1 {wrong # args: should be "resource write ?-id resourceId? ?-name resourceName? ?-file resourceRef? ?-force? resourceType data"}} -test resource-6.2 {resource write tests} {macOnly} { - list [catch {resource write _bad_type_ data} msg] $msg -} {1 {expected Macintosh OS type but got "_bad_type_"}} -test resource-6.3 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource close $id - set id [resource open rsrc2.file r] - set result [catch {resource write -file $id -name Hello TEXT foo} errMsg] - lappend result [string compare $errMsg "cannot write to resource file \"$id\", it was opened read only"] - lappend result [lsearch [resource list TEXT $id] Hello] - resource close $id - file delete rsrc2.file - set result -} {1 0 -1} -test resource-6.4 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -name Hello TEXT {set x "our test data"} - source -rsrc Hello rsrc2.file - resource close $id - file delete rsrc2.file - set x -} {our test data} -test resource-6.5 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -id 256 TEXT {HAHAHAHAHAHAHA} - set result [catch {resource write -file $id -id 256 TEXT {HOHOHOHOHOHO}} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {the resource 256 already exists, use "-force" to overwrite it.}} -test resource-6.6 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 256 -file rsrc2.file -protected {error "don't tread on me"} - set id [resource open rsrc2.file w] - set result [catch {resource write -id 256 -force -file $id TEXT {NAHNAHNANAHNAH}} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {could not write resource id 256 of type TEXT, it was protected.}} -test resource-6.7 {resource write tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -id 256 -name FOO TEXT {set x [list "our first test data"]} - resource write -file $id -id 256 -name BAR -force TEXT {set x [list "our second test data"]} - source -rsrcid 256 rsrc2.file - lappend x [resource list TEXT $id] - resource close $id - file delete rsrc2.file - set x -} {{our second test data} BAR} - -#Tests for listing open resource files -test resource-7.1 {resource file tests} {macOnly} { - catch {resource files foo bar} mssg - set mssg -} {wrong # args: should be "resource files ?resourceId?"} -test resource-7.2 {resource file tests} {macOnly} { - catch {file delete rsrc2.file} - set rsrcFiles [resource files] - set id [resource open rsrc2.file w] - set result [string compare $rsrcFiles [lrange [resource files] 1 end]] - lappend result [string compare $id [lrange [resource files] 0 0]] - resource close $id - file delete rsrc2.file - set result -} {0 0} -test resource-7.3 {resource file tests} {macOnly} { - set result 0 - foreach file [resource files] { - if {[catch {resource types $file}] != 0} { - set result 1 - } - } - set result -} {0} -test resource-7.4 {resource file tests} {macOnly} { - catch {resource files __NO_SUCH_RESOURCE__} mssg - set mssg -} {invalid resource file reference "__NO_SUCH_RESOURCE__"} -test resource-7.5 {resource file tests} {macOnly} { - set sys [resource files System] - string compare $sys [file join $env(SYS_FOLDER) System] -} {0} -test resource-7.6 {resource file tests} {macOnly} { - set app [resource files application] - string compare $app [info nameofexecutable] -} {0} - -#Tests for the resource delete command -test resource-8.1 {resource delete tests} {macOnly} { - list [catch {resource delete} msg] $msg -} {1 {wrong # args: should be "resource delete ?-id resourceId? ?-name resourceName? ?-file resourceRef? resourceType"}} -test resource-8.2 {resource delete tests} {macOnly} { - list [catch {resource delete TEXT} msg] $msg -} {1 {you must specify either "-id" or "-name" or both to "resource delete"}} -test resource-8.3 {resource delete tests} {macOnly} { - set result [catch {resource delete -file ffffff -id 128 TEXT} mssg] - lappend result $mssg -} {1 {invalid resource file reference "ffffff"}} -test resource-8.4 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 -file rsrc2.file {Some stuff} - set id [resource open rsrc2.file r] - set result [catch {resource delete -id 128 -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result [string compare $mssg "cannot delete from resource file \"$id\", it was opened read only"] -} {1 0} -test resource-8.5 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 -file rsrc2.file {Some stuff} - set id [resource open rsrc2.file w] - set result [catch {resource delete -id 128 -file $id _bad_type_} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {expected Macintosh OS type but got "_bad_type_"}} -test resource-8.5.1 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - set result [catch {resource delete -id 128 -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {resource not found}} -test resource-8.6 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - set result [catch {resource delete -name foo -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {resource not found}} -test resource-8.7 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - set id [resource open rsrc2.file w] - resource write -file $id -name foo -id 128 TEXT {some stuff} - resource write -file $id -name bar -id 129 TEXT {some stuff} - set result [catch {resource delete -name foo -id 129 -file $id TEXT} mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {"-id" and "-name" values do not point to the same resource}} -test resource-8.8 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 256 -file rsrc2.file -protected {error "don't tread on me"} - set id [resource open rsrc2.file w] - set result [catch {resource delete -id 256 -file $id TEXT } mssg] - resource close $id - file delete rsrc2.file - lappend result $mssg -} {1 {resource cannot be deleted: it is protected.}} -test resource-8.9 {resource delete tests} {macOnly} { - catch {file delete rsrc2.file} - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 -file rsrc2.file {Some stuff} - set id [resource open rsrc2.file w] - set result [resource list TEXT $id] - resource delete -id 128 -file $id TEXT - lappend result [resource list TEXT $id] - resource close $id - file delete rsrc2.file - set result -} {fileRsrcName {}} - -# Tests for the Mac version of the source command -catch {file delete rsrc.file} -test resource-9.1 {source command} {macOnly} { - testWriteTextResource -rsrc fileRsrcName -rsrcid 128 \ - -file rsrc.file {set rsrc_foo 1} - catch {unset rsrc_foo} - source -rsrc fileRsrcName rsrc.file - list [catch {set rsrc_foo} msg] $msg -} {0 1} -test resource-9.2 {source command} {macOnly} { - catch {unset rsrc_foo} - list [catch {source -rsrc no_resource rsrc.file} msg] $msg -} {1 {The resource "no_resource" could not be loaded from rsrc.file.}} -test resource-9.3 {source command} {macOnly} { - catch {unset rsrc_foo} - source -rsrcid 128 rsrc.file - list [catch {set rsrc_foo} msg] $msg -} {0 1} -test resource-9.4 {source command} {macOnly} { - catch {unset rsrc_foo} - list [catch {source -rsrcid bad_int rsrc.file} msg] $msg -} {1 {expected integer but got "bad_int"}} -test resource-9.5 {source command} {macOnly} { - catch {unset rsrc_foo} - list [catch {source -rsrcid 100 rsrc.file} msg] $msg -} {1 {The resource "ID=100" could not be loaded from rsrc.file.}} - -# cleanup -catch {file delete rsrc.file} -::tcltest::cleanupTests -return - - - - - - - - - - - - diff --git a/tests/socket.test b/tests/socket.test index 2b382d6..448e7d2 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -91,7 +91,7 @@ if {![info exists remoteServerPort]} { # set doTestsWithRemoteServer 1 -if {![info exists remoteServerIP] && ($tcl_platform(platform) != "macintosh")} { +if {![info exists remoteServerIP]} { set remoteServerIP 127.0.0.1 } if {($doTestsWithRemoteServer == 1) && (![info exists remoteServerPort])} { @@ -1154,12 +1154,6 @@ test socket-11.5 {remote echo, 50 lines} {socket doTestsWithRemoteServer} { sendCommand {close $socket10_7_test_server} set cnt } 50 -# Macintosh sockets can have more than one server per port -if {$tcl_platform(platform) == "macintosh"} { - set conflictResult {0 2836} -} else { - set conflictResult {1 {couldn't open socket: address already in use}} -} test socket-11.6 {socket conflict} {socket doTestsWithRemoteServer} { set s1 [socket -server accept 2836] if {[catch {set s2 [socket -server accept 2836]} msg]} { @@ -1170,7 +1164,7 @@ test socket-11.6 {socket conflict} {socket doTestsWithRemoteServer} { } close $s1 set result -} $conflictResult +} {1 {couldn't open socket: address already in use}} test socket-11.7 {server with several clients} {socket doTestsWithRemoteServer} { sendCommand { set socket10_9_test_server [socket -server accept 2836] diff --git a/tests/source.test b/tests/source.test index 06d6b51..db12707 100644 --- a/tests/source.test +++ b/tests/source.test @@ -204,110 +204,6 @@ test source-3.5 {return with special code etc.} -setup { invoked from within "source $sourcefile"} {a b c}} - -# Test for the Macintosh specfic features of the source command -test source-4.1 {source error conditions} -constraints macOnly -body { - source -rsrc _no_exist_ -} -result {The resource "_no_exist_" could not be loaded from application.} \ - -returnCodes error - -test source-4.2 {source error conditions} -constraints macOnly -body { - source -rsrcid bad_id -} -returnCodes error -result {expected integer but got "bad_id"} - -test source-4.3 {source error conditions} -constraints macOnly -body { - source -rsrc rsrcName fileName extra -} -returnCodes error -result {wrong # args: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?" or "source -encoding name fileName"} - -test source-4.4 {source error conditions} -constraints macOnly -body { - source non_switch rsrcName -} -returnCodes error -result {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?" or "source -encoding name fileName"} - -test source-4.5 {source error conditions} -constraints macOnly -body { - source -bad_switch argument -} -returnCodes error -result {bad argument: should be "source fileName" or "source -rsrc name ?fileName?" or "source -rsrcid id ?fileName?" or "source -encoding name fileName"} - - -testConstraint testWriteTextResource \ - [llength [info commands testWriteTextResource]] - -test source-5.1 {source resource files} -constraints macOnly -setup { - set sourcefile [makeFile {} bad_file] - removeFile bad_file -} -body { - source -rsrc rsrcName $sourcefile -} -returnCodes error -match glob -result {Error finding the file: "*bad_file".} - -test source-5.2 {source resource files} -constraints macOnly -setup { - set sourcefile [makeFile {return} source.file] -} -body { - source -rsrc rsrcName $sourcefile -} -cleanup { - removeFile source.file -} -returnCodes error -match glob \ - -result {Error reading the file: "*source.file".} - -test source-5.3 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrcFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrc rsrcName -file $rsrc.file {set msg2 ok; return} -} -body { - set result [catch {source -rsrc rsrcName rsrc.file} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list ok 0 {}] - -test source-5.4 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrsFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrc fileRsrcName \ - -file $rsrcFile {set msg2 ok; return} -} -body { - source -rsrc fileRsrcName $rsrcFile - set result [catch {source -rsrc fileRsrcName} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list ok 1 {The resource "fileRsrcName" could not be loaded from application.}] - -test source-5.5 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrcFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrcid 200 \ - -file $rsrcFile {set msg2 hello; set msg3 bye} -} -body { - set result [catch {source -rsrcid 200 $rsrcFile} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list hello 0 bye] - -test source-5.6 {source resource files} -constraints { - macOnly testWriteTextResource -} -setup { - set msg2 unset - set rsrcFile [makeFile {} rsrc.file] - removeFile rsrc.file - testWriteTextResource -rsrcid 200 \ - -file $rsrcFile {set msg2 hello; error bad; set msg3 bye} -} -body { - set result [catch {source -rsrcid 200 rsrc.file} msg] - list $msg2 $result $msg -} -cleanup { - removeFile rsrc.file -} -result [list hello 1 bad] - - test source-6.1 {source is binary ok} -setup { # Note [makeFile] writes in the system encoding. # [source] defaults to reading in the system encoding. |