From 2f9e6f4e94de87c7d5604bd757e9d6b297ae4a86 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 23 Mar 2016 17:15:18 -0700 Subject: [PATCH] [core] Allow the use of special characters in property field names Fixes #4336 --- src/mbgl/util/token.hpp | 2 +- test/util/token.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mbgl/util/token.hpp b/src/mbgl/util/token.hpp index a2cc267bf..722b08f77 100644 --- a/src/mbgl/util/token.hpp +++ b/src/mbgl/util/token.hpp @@ -8,7 +8,7 @@ namespace mbgl { namespace util { -const static std::string tokenReservedChars = "{}()[]<>$=:;.,^"; +const static std::string tokenReservedChars = "{}"; // Replaces {tokens} in a string by calling the lookup function. template diff --git a/test/util/token.cpp b/test/util/token.cpp index 79da03a97..a2885dc8d 100644 --- a/test/util/token.cpp +++ b/test/util/token.cpp @@ -39,12 +39,12 @@ TEST(Token, replaceTokens) { if (token == "dashed-property") return "dashed"; return ""; })); + EXPECT_EQ("colonized", mbgl::util::replaceTokens("{colon:property}", [](const std::string& token) -> std::string { + if (token == "colon:property") return "colonized"; + return ""; + })); EXPECT_EQ("150 m", mbgl::util::replaceTokens("{HØYDE} m", [](const std::string& token) -> std::string { if (token == "HØYDE") return "150"; return ""; })); - EXPECT_EQ("reserved {for:future} use", mbgl::util::replaceTokens("reserved {for:future} use", [](const std::string& token) -> std::string { - if (token == "for:future") return "unknown"; - return ""; - })); }