summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/fileName.test36
-rw-r--r--tests/winFCmd.test18
2 files changed, 44 insertions, 10 deletions
diff --git a/tests/fileName.test b/tests/fileName.test
index a1a0011..5545cb1 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.12 2001/08/23 17:37:08 vincentdarley Exp $
+# RCS: @(#) $Id: fileName.test,v 1.13 2001/08/30 08:53:15 vincentdarley Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -304,6 +304,26 @@ test filename-4.18 {Tcl_SplitPath: unix} {testsetplatform} {
testsetplatform unix
file split foo/bar~/baz
} {foo bar~ baz}
+test filename-4.19 {Tcl_SplitPath} {
+ set oldDir [pwd]
+ set res [catch {
+ file mkdir tildetmp
+ set nastydir [file join tildetmp ./~tilde]
+ file mkdir $nastydir
+ set norm [file normalize $nastydir]
+ cd tildetmp
+ cd ./~tilde
+ glob -nocomplain *
+ set idx [string first tildetmp $norm]
+ set norm [string range $norm $idx end]
+ # fix path away so all platforms are the same
+ regsub -all ":" $norm "/" norm
+ file delete -force $nastydir
+ set norm
+ } err]
+ cd $oldDir
+ list $res $err
+} {0 tildetmp/~tilde}
test filename-5.1 {Tcl_SplitPath: mac} {testsetplatform} {
testsetplatform mac
@@ -1367,6 +1387,20 @@ test filename-11.43 {Tcl_GlobCmd} {
test filename-11.44 {Tcl_GlobCmd} {
list [catch {glob -tails -path hello -directory hello *} msg] $msg
} {1 {"-directory" cannot be used with "-path"}}
+test filename-11.45 {Tcl_GlobCmd on root volume} {
+ set res1 ""
+ set res2 ""
+ catch {
+ set res1 [glob -dir [lindex [file volumes] 0] -tails *]
+ }
+ catch {
+ set tmpd [pwd]
+ cd [lindex [file volumes] 0]
+ set res2 [glob *]
+ cd $tmpd
+ }
+ expr {$res1 == $res2}
+} {1}
file rename $horribleglobname globTest
set globname globTest
diff --git a/tests/winFCmd.test b/tests/winFCmd.test
index b26f385..1e63666 100644
--- a/tests/winFCmd.test
+++ b/tests/winFCmd.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: winFCmd.test,v 1.10 2001/07/31 19:12:07 vincentdarley Exp $
+# RCS: @(#) $Id: winFCmd.test,v 1.11 2001/08/30 08:53:15 vincentdarley Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -529,7 +529,7 @@ test winFCmd-6.1 {TclpRemoveDirectory: errno: EACCES} {pcOnly} {
test winFCmd-6.2 {TclpRemoveDirectory: errno: EEXIST} {pcOnly} {
cleanup
file mkdir td1/td2
- list [catch {testfile rmdir td1} msg] $msg
+ list [catch {testfile rmdir td1} msg] [file tail $msg]
} {1 {td1 EEXIST}}
test winFCmd-6.3 {TclpRemoveDirectory: errno: EACCES} {pcOnly} {
# can't test this w/o removing everything on your hard disk first!
@@ -537,7 +537,7 @@ test winFCmd-6.3 {TclpRemoveDirectory: errno: EACCES} {pcOnly} {
} {}
test winFCmd-6.4 {TclpRemoveDirectory: errno: ENOENT} {pcOnly} {
cleanup
- list [catch {testfile rmdir td1} msg] $msg
+ list [catch {testfile rmdir td1} msg] [file tail $msg]
} {1 {td1 ENOENT}}
test winFCmd-6.5 {TclpRemoveDirectory: errno: ENOENT} {pcOnly} {
cleanup
@@ -546,7 +546,7 @@ test winFCmd-6.5 {TclpRemoveDirectory: errno: ENOENT} {pcOnly} {
test winFCmd-6.6 {TclpRemoveDirectory: errno: ENOTDIR} {pcOnly} {
cleanup
createfile tf1
- list [catch {testfile rmdir tf1} msg] $msg
+ list [catch {testfile rmdir tf1} msg] [file tail $msg]
} {1 {tf1 ENOTDIR}}
test winFCmd-6.7 {TclpRemoveDirectory: RemoveDirectory succeeds} {pcOnly} {
cleanup
@@ -557,7 +557,7 @@ test winFCmd-6.7 {TclpRemoveDirectory: RemoveDirectory succeeds} {pcOnly} {
test winFCmd-6.8 {TclpRemoveDirectory: RemoveDirectory fails} {pcOnly} {
cleanup
createfile tf1
- list [catch {testfile rmdir tf1} msg] $msg
+ list [catch {testfile rmdir tf1} msg] [file tail $msg]
} {1 {tf1 ENOTDIR}}
test winFCmd-6.9 {TclpRemoveDirectory: errno == EACCES} {pcOnly} {
cleanup
@@ -573,7 +573,7 @@ test winFCmd-6.10 {TclpRemoveDirectory: attr == -1} {95} {
test winFCmd-6.11 {TclpRemoveDirectory: attr == -1} {nt} {
cleanup
list [catch {testfile rmdir /} msg] $msg
-} {1 {\ EACCES}}
+} {1 {/ EACCES}}
test winFCmd-6.12 {TclpRemoveDirectory: errno == EACCES} {95} {
cleanup
createfile tf1
@@ -594,7 +594,7 @@ test winFCmd-6.14 {TclpRemoveDirectory: check if empty dir} {95} {
test winFCmd-6.15 {TclpRemoveDirectory: !recursive} {pcOnly} {
cleanup
file mkdir td1/td2
- list [catch {testfile rmdir td1} msg] $msg
+ list [catch {testfile rmdir td1} msg] [file tail $msg]
} {1 {td1 EEXIST}}
test winFCmd-6.16 {TclpRemoveDirectory: recursive, but errno != EEXIST} {pcOnly} {
cleanup
@@ -688,12 +688,12 @@ test winFCmd-7.14 {TraverseWinTree: append \ to target if necessary} {95} {
cleanup
file mkdir td1
list [catch {testfile cpdir td1 /} msg] $msg
-} {1 {\ EEXIST}}
+} {1 {/ EEXIST}}
test winFCmd-7.15 {TraverseWinTree: append \ to target if necessary} {nt} {
cleanup
file mkdir td1
list [catch {testfile cpdir td1 /} msg] $msg
-} {1 {\ EACCES}}
+} {1 {/ EACCES}}
test winFCmd-7.16 {TraverseWinTree: recurse on files: no files} {pcOnly} {
cleanup
file mkdir td1