Skip to content

Commit

Permalink
Added a test for weakly_canonical with a path starting with "..".
Browse files Browse the repository at this point in the history
Related to #311.
  • Loading branch information
Lastique committed Jul 3, 2024
1 parent c8093ee commit f853692
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/operations_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2821,6 +2821,7 @@ void weakly_canonical_basic_tests()
BOOST_TEST_EQ(fs::weakly_canonical(dir / "no-such/foo/../bar"), dir / "no-such/bar");
BOOST_TEST_EQ(fs::weakly_canonical(dir / "../no-such/foo/../bar"), dir.parent_path() / "no-such/bar");
BOOST_TEST_EQ(fs::weakly_canonical(dir / "no-such/../f0"), dir / "f0"); // dir / "f0" exists, dir / "no-such" does not
BOOST_TEST_EQ(fs::weakly_canonical("../foo", d1), dir / "foo");

#ifdef BOOST_WINDOWS_API
BOOST_TEST_EQ(fs::weakly_canonical("c:/no-such/foo/bar"), fs::path("c:/no-such/foo/bar"));
Expand Down

0 comments on commit f853692

Please sign in to comment.