summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley>2004-01-23 10:59:57 (GMT)
committervincentdarley <vincentdarley>2004-01-23 10:59:57 (GMT)
commit532cf499694027af6614c6a70eeb557bb6d29a6a (patch)
treea0c28b5eaba664ae2cf954de2a8c8c836e74c31a /tests
parentba9706852dcaec5a693270fd54a02746625b0a27 (diff)
downloadtcl-532cf499694027af6614c6a70eeb557bb6d29a6a.zip
tcl-532cf499694027af6614c6a70eeb557bb6d29a6a.tar.gz
tcl-532cf499694027af6614c6a70eeb557bb6d29a6a.tar.bz2
file normalize bug fixes for .. and .
Diffstat (limited to 'tests')
-rw-r--r--tests/fileSystem.test41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test
index 69db7f6..112e665 100644
--- a/tests/fileSystem.test
+++ b/tests/fileSystem.test
@@ -296,6 +296,47 @@ if {[tcltest::testConstraint testsetplatform]} {
testsetplatform $platform
}
+test filesystem-1.34 {file normalisation with '/./'} {
+ set res [file normalize /foo/bar/anc/./.tml]
+ if {[string first "/./" $res] != -1} {
+ set res "normalization of /foo/bar/anc/./.tml is: $res"
+ } else {
+ set res "ok"
+ }
+ set res
+} {ok}
+
+test filesystem-1.35 {file normalisation with '/./'} {
+ set res [file normalize /ffo/bar/anc/./foo/.tml]
+ if {[string first "/./" $res] != -1 || ([regsub -all "foo" $res "" reg] == 2)} {
+ set res "normalization of /ffo/bar/anc/./foo/.tml is: $res"
+ } else {
+ set res "ok"
+ }
+ set res
+} {ok}
+
+test filesystem-1.36 {file normalisation with '/./'} {
+ set res [file normalize /foo/bar/anc/././asdasd/.tml]
+ if {[string first "/./" $res] != -1 || ([regsub -all "asdasd" $res "" reg] == 2) } {
+ set res "normalization of /foo/bar/anc/././asdasd/.tml is: $res"
+ } else {
+ set res "ok"
+ }
+ set res
+} {ok}
+
+test filesystem-1.37 {file normalisation with '/./'} {
+ set fname "/abc/./def/./ghi/./asda/.././.././asd/x/../../../../....."
+ set res [file norm $fname]
+ if {[string first "//" $res] != -1} {
+ set res "normalization of $fname is: $res"
+ } else {
+ set res "ok"
+ }
+ set res
+} {ok}
+
test filesystem-2.0 {new native path} {unixOnly} {
foreach f [lsort [glob -nocomplain /usr/bin/c*]] {
catch {file readlink $f}