diff --git a/test/data b/test/data index 14eabf8f4..fb1529e22 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit 14eabf8f407294e71636cddfce68297a4f4e0303 +Subproject commit fb1529e225b36f8a3077ad23f7005951a07c8a7e diff --git a/test/unit/datasource/geojson.cpp b/test/unit/datasource/geojson.cpp index 6d953c8bd..bcc9fa2e6 100644 --- a/test/unit/datasource/geojson.cpp +++ b/test/unit/datasource/geojson.cpp @@ -115,6 +115,26 @@ TEST_CASE("geojson") { } } + SECTION("GeoJSON attribute descriptors are alphabetically ordered") + { + for (auto cache_features : {true, false}) + { + mapnik::parameters params; + params["type"] = "geojson"; + params["file"] = "./test/data/json/properties.json"; + params["cache_features"] = cache_features; + auto ds = mapnik::datasource_cache::instance().create(params); + CHECK(ds != nullptr); + std::vector expected_names = {"a", "b", "c", "d", "e"}; + auto fields = ds->get_descriptor().get_descriptors(); + std::size_t index = 0; + for (auto const& field : fields) + { + REQUIRE(field.get_name() == expected_names[index++]); + } + } + } + SECTION("GeoJSON invalid Point") { for (auto cache_features : {true, false})