test geojson.cpp - add empty properties (ref #3426)

This commit is contained in:
artemp 2016-05-13 12:48:56 +02:00
parent 4e6aeaedfc
commit 3ec25e36fe

View file

@ -687,7 +687,7 @@ TEST_CASE("geojson") {
auto ds = mapnik::datasource_cache::instance().create(params); auto ds = mapnik::datasource_cache::instance().create(params);
REQUIRE(bool(ds)); REQUIRE(bool(ds));
auto fields = ds->get_descriptor().get_descriptors(); auto fields = ds->get_descriptor().get_descriptors();
std::initializer_list<std::string> names = {"NOM_FR","array","boolean","description","double","int","name","object","spaces"}; std::initializer_list<std::string> names = {"NOM_FR","array","boolean","description","double","empty_array", "empty_object","int","name","object","spaces"};
REQUIRE_FIELD_NAMES(fields, names); REQUIRE_FIELD_NAMES(fields, names);
auto fs = all_features(ds); auto fs = all_features(ds);
@ -705,7 +705,9 @@ TEST_CASE("geojson") {
attr{"spaces", mapnik::value_unicode_string("this has spaces")}, attr{"spaces", mapnik::value_unicode_string("this has spaces")},
attr{"array", mapnik::value_unicode_string("[\"string\",\"value with spaces\",3,1.1,null,true," attr{"array", mapnik::value_unicode_string("[\"string\",\"value with spaces\",3,1.1,null,true,"
"\"Québec\",{name:\"object within an array\"}," "\"Québec\",{name:\"object within an array\"},"
"[\"array\",\"within\",\"an\",\"array\"]]")} "[\"array\",\"within\",\"an\",\"array\"]]")},
attr{"empty_array", mapnik::value_unicode_string("[]")},
attr{"empty_object", mapnik::value_unicode_string("{}")},
}; };
auto feature = fs->next(); auto feature = fs->next();
REQUIRE(bool(feature)); REQUIRE(bool(feature));