diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/style_parser/geojson-data-inline.style.json | 2 | ||||
-rw-r--r-- | test/style/filter.cpp | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/test/fixtures/style_parser/geojson-data-inline.style.json b/test/fixtures/style_parser/geojson-data-inline.style.json index fc4fe97c78..a5d19eea60 100644 --- a/test/fixtures/style_parser/geojson-data-inline.style.json +++ b/test/fixtures/style_parser/geojson-data-inline.style.json @@ -3,7 +3,7 @@ "sources": { "mapbox": { "type": "geojson", - "data": { "type": "Feature", "geometry": { "type": "Point", "coordinates": [100.0, 0.0] } } + "data": { "type": "Feature", "geometry": { "type": "Point", "coordinates": [100.0, 0.0] }, "properties": {} } } } } 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, {{}})); } |