diff options
-rw-r--r-- | src/utils/stringutils_unittest.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/utils/stringutils_unittest.cc b/src/utils/stringutils_unittest.cc index 9d3285ccc..7a303e2ac 100644 --- a/src/utils/stringutils_unittest.cc +++ b/src/utils/stringutils_unittest.cc @@ -1416,6 +1416,22 @@ TEST_CASE("stringuntils pathJoin2") "dir1" + sep + "dir2" + sep + "dir3" + sep + "dir4" + sep + "dir5"); } +TEST_CASE("stringuntils urlJoin") +{ + REQUIRE(urlJoin("", "") == "/"); + REQUIRE(urlJoin("/", "") == "/"); + REQUIRE(urlJoin("", "/") == "/"); + REQUIRE(urlJoin("/", "/") == "/"); + REQUIRE(urlJoin("dir1", "dir2") == "dir1/dir2"); + REQUIRE(urlJoin("dir1/", "dir2") == "dir1/dir2"); + REQUIRE(urlJoin("dir1", "/dir2") == "dir1/dir2"); + REQUIRE(urlJoin("dir1/", "/dir2") == "dir1/dir2"); + REQUIRE(urlJoin("dir1/dir2/dir3", "dir4") == "dir1/dir2/dir3/dir4"); + REQUIRE(urlJoin("dir1/dir2/", "dir3/dir4") == "dir1/dir2/dir3/dir4"); + REQUIRE(urlJoin("dir1/dir2", "dir3/dir4") == "dir1/dir2/dir3/dir4"); + REQUIRE(urlJoin("dir1/dir2", "/dir3/dir4") == "dir1/dir2/dir3/dir4"); +} + TEST_CASE("stringuntils secureChatCommand") { std::string str; |