diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-08 19:58:41 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-08 19:58:41 +0000 |
commit | cab3f4977a412681a77767ec7307ee642b61332d (patch) | |
tree | 469274938dd5a59f93dad4f4e8dffa5f27593c80 /src/test.cc | |
parent | 333f4963de6d174d852774a88ada852f77f57994 (diff) |
* A path canonicaliser that doesn't depend on the existence of paths
(i.e., it doesn't use realpath(3), which is broken in any case).
Therefore it doesn't resolve symlinks.
Diffstat (limited to 'src/test.cc')
-rw-r--r-- | src/test.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test.cc b/src/test.cc index b30a5b0e9..c2a1cd3bf 100644 --- a/src/test.cc +++ b/src/test.cc @@ -71,6 +71,15 @@ void runTests() abort(); } catch (BadRefError err) { }; + /* Path canonicalisation. */ + cout << canonPath("/./../././//") << endl; + cout << canonPath("/foo/bar") << endl; + cout << canonPath("///foo/////bar//") << endl; + cout << canonPath("/././/foo/////bar//.") << endl; + cout << canonPath("/foo////bar//..///x/") << endl; + cout << canonPath("/foo////bar//..//..//x/y/../z/") << endl; + cout << canonPath("/foo/bar/../../../..///") << endl; + /* Dumping. */ #if 0 |