summaryrefslogtreecommitdiffstats
path: root/Source/Checks/cm_cxx_filesystem.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Checks/cm_cxx_filesystem.cxx')
-rw-r--r--Source/Checks/cm_cxx_filesystem.cxx27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx_filesystem.cxx b/Source/Checks/cm_cxx_filesystem.cxx
new file mode 100644
index 0000000..ae8acc5
--- /dev/null
+++ b/Source/Checks/cm_cxx_filesystem.cxx
@@ -0,0 +1,27 @@
+
+#include <filesystem>
+
+int main()
+{
+ std::filesystem::path p0(L"/a/b/c");
+
+ std::filesystem::path p1("/a/b/c");
+ std::filesystem::path p2("/a/b/c");
+ if (p1 != p2) {
+ return 1;
+ }
+
+#if defined(_WIN32)
+ std::filesystem::path p3("//host/a/b/../c");
+ if (p3.lexically_normal().generic_string() != "//host/a/c") {
+ return 1;
+ }
+
+ std::filesystem::path p4("c://a/.///b/../");
+ if (p4.lexically_normal().generic_string() != "c:/a/") {
+ return 1;
+ }
+#endif
+
+ return 0;
+}