summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorvincentdarley <vincentdarley@noemail.net>2004-01-23 10:59:56 (GMT)
committervincentdarley <vincentdarley@noemail.net>2004-01-23 10:59:56 (GMT)
commit2e2cf79cb59c2eddabb230917309265d145bbd8a (patch)
treea0c28b5eaba664ae2cf954de2a8c8c836e74c31a /tests
parent266621f0317f979d6517219864c2f3b1e80e0796 (diff)
downloadtcl-2e2cf79cb59c2eddabb230917309265d145bbd8a.zip
tcl-2e2cf79cb59c2eddabb230917309265d145bbd8a.tar.gz
tcl-2e2cf79cb59c2eddabb230917309265d145bbd8a.tar.bz2
file normalize bug fixes for .. and .
FossilOrigin-Name: 53c4f86a0186abda6b374fc576457f5fbfd16217
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}