Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/tcl8.5.2/tests/unixFile.test @ 31

Last change on this file since 31 was 25, checked in by landauf, 17 years ago

added tcl to libs

File size: 1.9 KB
Line 
1# This file contains tests for the routines in the file tclUnixFile.c
2#
3# This file contains a collection of tests for one or more of the Tcl
4# built-in commands.  Sourcing this file into Tcl runs the tests and
5# generates output for errors.  No output means no errors were found.
6#
7# Copyright (c) 1998-1999 by Scriptics Corporation.
8#
9# See the file "license.terms" for information on usage and redistribution
10# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
11#
12# RCS: @(#) $Id: unixFile.test,v 1.9 2004/06/23 15:36:58 dkf Exp $
13
14if {[lsearch [namespace children] ::tcltest] == -1} {
15    package require tcltest
16    namespace import -force ::tcltest::*
17}
18
19testConstraint testfindexecutable [llength [info commands testfindexecutable]]
20
21set oldpwd [pwd]
22cd [temporaryDirectory]
23
24catch {
25    set oldPath $env(PATH)
26    file attributes [makeFile "" junk] -perm 0777
27}
28set absPath [file join [temporaryDirectory] junk]
29
30test unixFile-1.1 {Tcl_FindExecutable} {testfindexecutable unix} {
31    set env(PATH) ""
32    testfindexecutable junk
33} $absPath
34test unixFile-1.2 {Tcl_FindExecutable} {testfindexecutable unix} {
35    set env(PATH) "/dummy"
36    testfindexecutable junk
37} {}
38test unixFile-1.3 {Tcl_FindExecutable} {testfindexecutable unix} {
39    set env(PATH) "/dummy:[pwd]"
40    testfindexecutable junk
41} $absPath
42test unixFile-1.4 {Tcl_FindExecutable} {testfindexecutable unix} {
43    set env(PATH) "/dummy:"
44    testfindexecutable junk
45} $absPath
46test unixFile-1.5 {Tcl_FindExecutable} {testfindexecutable unix} {
47    set env(PATH) "/dummy:/dummy"
48    testfindexecutable junk
49} {}
50test unixFile-1.6 {Tcl_FindExecutable} {testfindexecutable unix} {
51    set env(PATH) "/dummy::/dummy"
52    testfindexecutable junk
53} $absPath
54test unixFile-1.7 {Tcl_FindExecutable} {testfindexecutable unix} {
55    set env(PATH) ":/dummy"
56    testfindexecutable junk
57} $absPath
58
59# cleanup
60catch {set env(PATH) $oldPath}
61removeFile junk
62cd $oldpwd
63::tcltest::cleanupTests
64return
Note: See TracBrowser for help on using the repository browser.