diff options
Diffstat (limited to 'test/style/filter.cpp')
-rw-r--r-- | test/style/filter.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/test/style/filter.cpp b/test/style/filter.cpp index 2d26a8eb61..53504d84ae 100644 --- a/test/style/filter.cpp +++ b/test/style/filter.cpp @@ -8,20 +8,16 @@ #include <rapidjson/document.h> -#include <map> - using namespace mbgl; using namespace mbgl::style; -typedef std::multimap<std::string, mbgl::Value> Properties; - Filter parse(const char * expression) { rapidjson::GenericDocument<rapidjson::UTF8<>, rapidjson::CrtAllocator> doc; doc.Parse<0>(expression); return *conversion::convert<Filter>(doc); } -bool evaluate(const Filter& filter, const Properties& properties, FeatureType type = FeatureType::Unknown) { +bool evaluate(const Filter& filter, const PropertyMap& properties, FeatureType type = FeatureType::Unknown) { return filter(type, [&] (const std::string& key) -> optional<Value> { auto it = properties.find(key); if (it == properties.end()) @@ -47,6 +43,7 @@ TEST(Filter, EqualsNumber) { ASSERT_FALSE(evaluate(f, {{ "foo", std::string("0") }})); ASSERT_FALSE(evaluate(f, {{ "foo", false }})); ASSERT_FALSE(evaluate(f, {{ "foo", true }})); + ASSERT_FALSE(evaluate(f, {{ "foo", nullptr }})); ASSERT_FALSE(evaluate(f, {{}})); } |