forked from organicmaps/organicmaps
[base] url join review fixes
This commit is contained in:
parent
660ab57e7b
commit
3751d0e36f
2 changed files with 3 additions and 5 deletions
|
@ -5,10 +5,13 @@
|
|||
UNIT_TEST(Url_Join)
|
||||
{
|
||||
TEST_EQUAL("", base::url::Join("", ""), ());
|
||||
TEST_EQUAL("omim/", base::url::Join("", "omim/"), ());
|
||||
TEST_EQUAL("omim/", base::url::Join("omim/", ""), ());
|
||||
TEST_EQUAL("omim/strings", base::url::Join("omim", "strings"), ());
|
||||
TEST_EQUAL("omim/strings", base::url::Join("omim/", "strings"), ());
|
||||
TEST_EQUAL("../../omim/strings", base::url::Join("..", "..", "omim", "strings"), ());
|
||||
TEST_EQUAL("../../omim/strings", base::url::Join("../", "..", "omim/", "strings"), ());
|
||||
TEST_EQUAL("omim/strings", base::url::Join("omim/", "/strings"), ());
|
||||
TEST_EQUAL("../../omim/strings", base::url::Join("../", "/../", "/omim/", "/strings"), ());
|
||||
TEST_EQUAL("../omim/strings", base::url::Join("../", "", "/omim/", "/strings"), ());
|
||||
}
|
||||
|
|
|
@ -27,11 +27,6 @@ std::string Join(std::string const & lhs, std::string const & rhs);
|
|||
template <typename... Args>
|
||||
std::string Join(std::string const & lhs, std::string const & rhs, Args &&... args)
|
||||
{
|
||||
if (lhs.empty())
|
||||
return Join(rhs, std::forward<Args>(args)...);
|
||||
if (rhs.empty())
|
||||
return Join(lhs, std::forward<Args>(args)...);
|
||||
|
||||
return Join(Join(lhs, rhs), std::forward<Args>(args)...);
|
||||
}
|
||||
} // namespace url
|
||||
|
|
Loading…
Add table
Reference in a new issue