diff options
author | dgp <dgp@users.sourceforge.net> | 2006-03-03 04:32:11 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-03-03 04:32:11 (GMT) |
commit | a0d9058325f3f9f666dedb54d330ac9a8f01eb7b (patch) | |
tree | bd0163f436ca325cf76fed96e1bc13acf023109d /tests | |
parent | 6c7e5a2b7ad325e8fdbbc938610a28b6bd713536 (diff) | |
download | tcl-a0d9058325f3f9f666dedb54d330ac9a8f01eb7b.zip tcl-a0d9058325f3f9f666dedb54d330ac9a8f01eb7b.tar.gz tcl-a0d9058325f3f9f666dedb54d330ac9a8f01eb7b.tar.bz2 |
* generic/tclPathObj.c: Fix for failed normalization of
* tests/fileSystem.test: paths with /../ that lead back
to the root of the filesystem, like /foo/.. [Bug 1379287].
Diffstat (limited to 'tests')
-rw-r--r-- | tests/fileSystem.test | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test index 3c0bac2..7487743 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -370,6 +370,76 @@ test filesystem-1.41 {file normalisation with repeated separators} {win} { set res "ok" } } {ok} +test filesystem-1.42 {file normalisation .. beyond root (Bug 1379287)} { + set a [file norm /xxx/..] + set b [file norm /] + + if {![string equal $a $b]} { + set res "Paths should be equal: $a , $b" + } else { + set res "ok" + } +} {ok} +test filesystem-1.42.1 {file normalisation .. beyond root (Bug 1379287)} { + set a [file norm /xxx/../] + set b [file norm /] + + if {![string equal $a $b]} { + set res "Paths should be equal: $a , $b" + } else { + set res "ok" + } +} {ok} +test filesystem-1.43 {file normalisation .. beyond root (Bug 1379287)} { + set a [file norm /xxx/foo/../..] + set b [file norm /] + + if {![string equal $a $b]} { + set res "Paths should be equal: $a , $b" + } else { + set res "ok" + } +} {ok} +test filesystem-1.43.1 {file normalisation .. beyond root (Bug 1379287)} { + set a [file norm /xxx/foo/../../] + set b [file norm /] + + if {![string equal $a $b]} { + set res "Paths should be equal: $a , $b" + } else { + set res "ok" + } +} {ok} +test filesystem-1.44 {file normalisation .. beyond root (Bug 1379287)} { + set a [file norm /xxx/foo/../../bar] + set b [file norm /bar] + + if {![string equal $a $b]} { + set res "Paths should be equal: $a , $b" + } else { + set res "ok" + } +} {ok} +test filesystem-1.45 {file normalisation .. beyond root (Bug 1379287)} { + set a [file norm /xxx/../../bar] + set b [file norm /bar] + + if {![string equal $a $b]} { + set res "Paths should be equal: $a , $b" + } else { + set res "ok" + } +} {ok} +test filesystem-1.46 {file normalisation .. beyond root (Bug 1379287)} { + set a [file norm /xxx/../bar] + set b [file norm /bar] + + if {![string equal $a $b]} { + set res "Paths should be equal: $a , $b" + } else { + set res "ok" + } +} {ok} test filesystem-2.0 {new native path} {unix} { foreach f [lsort [glob -nocomplain /usr/bin/c*]] { |