aboutsummaryrefslogtreecommitdiff
path: root/test/common/str.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/common/str.h')
-rw-r--r--test/common/str.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/common/str.h b/test/common/str.h
index 0dee16a493..2c563f3132 100644
--- a/test/common/str.h
+++ b/test/common/str.h
@@ -284,6 +284,19 @@ class StringTestSuite : public CxxTest::TestSuite
TS_ASSERT_EQUALS(Common::normalizePath("foo/./bar", '/'), "foo/bar");
TS_ASSERT_EQUALS(Common::normalizePath("foo//./bar//", '/'), "foo/bar");
TS_ASSERT_EQUALS(Common::normalizePath("foo//.bar//", '/'), "foo/.bar");
+
+ TS_ASSERT_EQUALS(Common::normalizePath("..", '/'), "..");
+ TS_ASSERT_EQUALS(Common::normalizePath("../", '/'), "..");
+ TS_ASSERT_EQUALS(Common::normalizePath("/..", '/'), "/..");
+ TS_ASSERT_EQUALS(Common::normalizePath("../bar", '/'), "../bar");
+ TS_ASSERT_EQUALS(Common::normalizePath("foo//../", '/'), "");
+ TS_ASSERT_EQUALS(Common::normalizePath("foo/../bar", '/'), "bar");
+ TS_ASSERT_EQUALS(Common::normalizePath("foo//../bar//", '/'), "bar");
+ TS_ASSERT_EQUALS(Common::normalizePath("foo//..bar//", '/'), "foo/..bar");
+
+ TS_ASSERT_EQUALS(Common::normalizePath("foo/../../bar//", '/'), "../bar");
+ TS_ASSERT_EQUALS(Common::normalizePath("../foo/../bar", '/'), "../bar");
+ TS_ASSERT_EQUALS(Common::normalizePath("../../foo/bar/", '/'), "../../foo/bar");
}
void test_matchString() {