aboutsummaryrefslogtreecommitdiff
path: root/tests/path
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-30 16:36:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-30 16:36:53 +0200
commite37cf91f24fc409fa0aa84500245f57c685fc8ea (patch)
tree2c0730f6c4226b054cb5eaf640fd0bb704536dae /tests/path
parent6597c9b777b608a96974b4a7a8c15234b05ffdd8 (diff)
Implement support for Windows path actualization
Diffstat (limited to 'tests/path')
-rw-r--r--tests/path/driver.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/path/driver.cxx b/tests/path/driver.cxx
index 7ca36b7..fbcaf33 100644
--- a/tests/path/driver.cxx
+++ b/tests/path/driver.cxx
@@ -478,6 +478,28 @@ main ()
assert (path::home ().absolute ());
//assert (wpath::home ().absolute ());
+ // normalize and actualize
+ //
+#ifdef _WIN32
+ {
+ auto test = [] (const char* p)
+ {
+ return path (p).normalize (true).representation ();
+ };
+
+ assert (test ("c:") == "C:");
+ assert (test ("c:/") == "C:\\");
+ assert (test ("c:\\pROGRAM fILES/") == "C:\\Program Files\\");
+ assert (test ("c:\\pROGRAM fILES/NonSense") ==
+ "C:\\Program Files\\NonSense");
+ assert (test ("c:\\pROGRAM fILES/NonSense\\sTUFF/") ==
+ "C:\\Program Files\\NonSense\\sTUFF\\");
+
+ dir_path cwd (path::current ());
+ assert (cwd.normalize (true).representation () == cwd.representation ());
+ }
+#endif
+
/*
path p ("../foo");
p.complete ();