From f522e7351a1eaffcd4b0f1f06fab65a44281f972 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Fri, 16 Dec 2016 17:35:58 -0500 Subject: Fix RemoveRelatvePathComponents This used to return "/foo" for "../foo" when it should return the enpty string (i.e., error removing all relative components). --- src/unittest/test_filepath.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/unittest') diff --git a/src/unittest/test_filepath.cpp b/src/unittest/test_filepath.cpp index 5e3cdcc08..ac2d69b5a 100644 --- a/src/unittest/test_filepath.cpp +++ b/src/unittest/test_filepath.cpp @@ -251,7 +251,10 @@ void TestFilePath::testRemoveRelativePathComponent() UASSERT(result == p("/home/user/minetest/worlds/world1")); path = p("."); result = fs::RemoveRelativePathComponents(path); - UASSERT(result == "."); + UASSERT(result == ""); + path = p("../a"); + result = fs::RemoveRelativePathComponents(path); + UASSERT(result == ""); path = p("./subdir/../.."); result = fs::RemoveRelativePathComponents(path); UASSERT(result == ""); -- cgit v1.2.3