about summary refs log tree commit diff
path: root/src/test.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-08T19·58+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-08T19·58+0000
commitcab3f4977a412681a77767ec7307ee642b61332d (patch)
tree469274938dd5a59f93dad4f4e8dffa5f27593c80 /src/test.cc
parent333f4963de6d174d852774a88ada852f77f57994 (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.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test.cc b/src/test.cc
index b30a5b0e90b6..c2a1cd3bfd55 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