diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-03-23 17:15:18 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-03-23 17:15:18 -0700 |
commit | 2f9e6f4e94de87c7d5604bd757e9d6b297ae4a86 (patch) | |
tree | 42216113ffd87c637c0838166bfdb919984a728a | |
parent | 6454847028cc3cc57711eb2dbc26351994a3ef13 (diff) | |
download | qtlocation-mapboxgl-2f9e6f4e94de87c7d5604bd757e9d6b297ae4a86.tar.gz |
[core] Allow the use of special characters in property field names
Fixes #4336
-rw-r--r-- | src/mbgl/util/token.hpp | 2 | ||||
-rw-r--r-- | 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 a2cc267bfe..722b08f773 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 <typename Lookup> diff --git a/test/util/token.cpp b/test/util/token.cpp index 79da03a97e..a2885dc8dd 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("150 m", mbgl::util::replaceTokens("{HØYDE} m", [](const std::string& token) -> std::string { - if (token == "HØYDE") return "150"; + EXPECT_EQ("colonized", mbgl::util::replaceTokens("{colon:property}", [](const std::string& token) -> std::string { + if (token == "colon:property") return "colonized"; 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"; + EXPECT_EQ("150 m", mbgl::util::replaceTokens("{HØYDE} m", [](const std::string& token) -> std::string { + if (token == "HØYDE") return "150"; return ""; })); } |