Skip to content

Commit

Permalink
refs #11, added more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed May 3, 2019
1 parent 882c60b commit 43e75c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
#define LWG_2937_BEHAVIOUR

// ghc::filesystem version in decimal (major * 10000 + minor * 100 + patch)
#define GHC_FILESYSTEM_VERSION 10100L
#define GHC_FILESYSTEM_VERSION 10101L

namespace ghc {
namespace filesystem {
Expand Down
8 changes: 7 additions & 1 deletion test/filesystem_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,13 @@ TEST_CASE("30.10.8.4.11 path generation", "[filesystem][path][fs.path.gen]")
CHECK(fs::path("/foo/../..").lexically_normal() == "/");
CHECK(fs::path("foo/..").lexically_normal() == ".");
CHECK(fs::path("ab/cd/ef/../../qw").lexically_normal() == "ab/qw");

CHECK(fs::path("a/b/../../../c").lexically_normal() == "../c");
#ifdef GHC_OS_WINDOWS
CHECK(fs::path("\\/\\///\\/").lexically_normal() == "/");
CHECK(fs::path("a/b/..\\//..///\\/../c\\\\/").lexically_normal() == "../c/");
CHECK(fs::path("..a/b/..\\//..///\\/../c\\\\/").lexically_normal() == "../c/");
#endif

// lexically_relative()
CHECK(fs::path("/a/d").lexically_relative("/a/b/c") == "../../d");
CHECK(fs::path("/a/b/c").lexically_relative("/a/d") == "../b/c");
Expand Down

0 comments on commit 43e75c3

Please sign in to comment.