diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-04-18 18:06:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-04-18 18:06:34 +0300 |
commit | ad2f090abf668819b3a6c96fc35d25ad50e6eb1e (patch) | |
tree | 481600eaf05845c4673170d7e83878ff5bc3a3da | |
parent | 630f0815458c8cbc8f702e12b92153000fd32bcc (diff) | |
download | manaverse-ad2f090abf668819b3a6c96fc35d25ad50e6eb1e.tar.gz manaverse-ad2f090abf668819b3a6c96fc35d25ad50e6eb1e.tar.bz2 manaverse-ad2f090abf668819b3a6c96fc35d25ad50e6eb1e.tar.xz manaverse-ad2f090abf668819b3a6c96fc35d25ad50e6eb1e.zip |
Add test for function urlJoin.
-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; |