summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-05-18 15:02:26 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-05-18 17:19:45 -0700
commita84ac4c8d79952fa3031f5414b10a560fdef2e1d (patch)
treec6d3d065561ea7bddb6efc7153fb9a8ebecb50d9 /test
parentb2fabe5eefc81cc38866a4856d6db37f4471d6ae (diff)
downloadqtlocation-mapboxgl-a84ac4c8d79952fa3031f5414b10a560fdef2e1d.tar.gz
[core] Align URL token replacement behavior with GL JS
I.e. preserve unknown tokens in URLs rather than replacing them with an empty string.
Diffstat (limited to 'test')
-rw-r--r--test/util/token.test.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/util/token.test.cpp b/test/util/token.test.cpp
index a2885dc8dd..d0cf1e31cf 100644
--- a/test/util/token.test.cpp
+++ b/test/util/token.test.cpp
@@ -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 {};
+ }));
}