From e37cf91f24fc409fa0aa84500245f57c685fc8ea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 30 Jul 2016 16:36:53 +0200 Subject: Implement support for Windows path actualization --- tests/path/driver.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'tests/path') 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 (); -- cgit v1.1