summaryrefslogtreecommitdiffstats
path: root/tests/unixFile.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unixFile.test')
-rw-r--r--tests/unixFile.test49
1 files changed, 18 insertions, 31 deletions
diff --git a/tests/unixFile.test b/tests/unixFile.test
index c046e71..8147f48 100644
--- a/tests/unixFile.test
+++ b/tests/unixFile.test
@@ -8,71 +8,58 @@
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
-#
-# RCS: @(#) $Id: unixFile.test,v 1.6 2000/04/10 17:19:05 ericm Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
namespace import -force ::tcltest::*
}
-if {[info commands testobj] == {}} {
- puts "This application hasn't been compiled with the \"testfindexecutable\""
- puts "command, so I can't test the Tcl_FindExecutable function"
- ::tcltest::cleanupTests
- return
-}
+::tcltest::loadTestedCommands
+catch [list package require -exact Tcltest [info patchlevel]]
+
+testConstraint testfindexecutable [llength [info commands testfindexecutable]]
+
+set oldpwd [pwd]
+cd [temporaryDirectory]
catch {
set oldPath $env(PATH)
- close [open junk w]
- file attributes junk -perm 0777
+ file attributes [makeFile "" junk] -perm 0777
}
-set absPath [file join [pwd] junk]
+set absPath [file join [temporaryDirectory] junk]
-test unixFile-1.1 {Tcl_FindExecutable} {unixOnly} {
+test unixFile-1.1 {Tcl_FindExecutable} {testfindexecutable unix} {
set env(PATH) ""
testfindexecutable junk
} $absPath
-test unixFile-1.2 {Tcl_FindExecutable} {unixOnly} {
+test unixFile-1.2 {Tcl_FindExecutable} {testfindexecutable unix} {
set env(PATH) "/dummy"
testfindexecutable junk
} {}
-test unixFile-1.3 {Tcl_FindExecutable} {unixOnly} {
+test unixFile-1.3 {Tcl_FindExecutable} {testfindexecutable unix} {
set env(PATH) "/dummy:[pwd]"
testfindexecutable junk
} $absPath
-test unixFile-1.4 {Tcl_FindExecutable} {unixOnly} {
+test unixFile-1.4 {Tcl_FindExecutable} {testfindexecutable unix} {
set env(PATH) "/dummy:"
testfindexecutable junk
} $absPath
-test unixFile-1.5 {Tcl_FindExecutable} {unixOnly} {
+test unixFile-1.5 {Tcl_FindExecutable} {testfindexecutable unix} {
set env(PATH) "/dummy:/dummy"
testfindexecutable junk
} {}
-test unixFile-1.6 {Tcl_FindExecutable} {unixOnly} {
+test unixFile-1.6 {Tcl_FindExecutable} {testfindexecutable unix} {
set env(PATH) "/dummy::/dummy"
testfindexecutable junk
} $absPath
-test unixFile-1.7 {Tcl_FindExecutable} {unixOnly} {
+test unixFile-1.7 {Tcl_FindExecutable} {testfindexecutable unix} {
set env(PATH) ":/dummy"
testfindexecutable junk
} $absPath
# cleanup
catch {set env(PATH) $oldPath}
-file delete junk
+removeFile junk
+cd $oldpwd
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-