From f853692086bab0dce78396d0df5f0a03c8e7d60f Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Wed, 3 Jul 2024 14:20:41 +0300 Subject: [PATCH] Added a test for weakly_canonical with a path starting with "..". Related to https://github.com/boostorg/filesystem/issues/311. --- test/operations_test.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/test/operations_test.cpp b/test/operations_test.cpp index 7f379377d..201e7c007 100644 --- a/test/operations_test.cpp +++ b/test/operations_test.cpp @@ -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"));