[core] Align URL token replacement behavior with GL JS

I.e. preserve unknown tokens in URLs rather than replacing them with an empty string.
This commit is contained in:
John Firebaugh
2018-05-18 15:02:26 -07:00
parent b2fabe5eef
commit a84ac4c8d7
7 changed files with 31 additions and 7 deletions

View File

@@ -47,4 +47,7 @@ TEST(Token, replaceTokens) {
if (token == "HØYDE") return "150";
return "";
}));
EXPECT_EQ("{unknown}", mbgl::util::replaceTokens("{unknown}", [](const std::string&) -> optional<std::string> {
return {};
}));
}