summaryrefslogtreecommitdiff
path: root/test/style/conversion/geojson_options.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/style/conversion/geojson_options.test.cpp')
-rw-r--r--test/style/conversion/geojson_options.test.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/style/conversion/geojson_options.test.cpp b/test/style/conversion/geojson_options.test.cpp
index 181189775b..aa84686dce 100644
--- a/test/style/conversion/geojson_options.test.cpp
+++ b/test/style/conversion/geojson_options.test.cpp
@@ -38,6 +38,7 @@ TEST(GeoJSONOptions, RetainsDefaults) {
ASSERT_EQ(converted.cluster, defaults.cluster);
ASSERT_EQ(converted.clusterRadius, defaults.clusterRadius);
ASSERT_EQ(converted.clusterMaxZoom, defaults.clusterMaxZoom);
+ ASSERT_TRUE(converted.clusterProperties.empty());
}
TEST(GeoJSONOptions, FullConversion) {
@@ -49,7 +50,12 @@ TEST(GeoJSONOptions, FullConversion) {
"cluster": true,
"clusterRadius": 4,
"clusterMaxZoom": 5,
- "lineMetrics": true
+ "lineMetrics": true,
+ "clusterProperties": {
+ "max": ["max", ["get", "scalerank"]],
+ "sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]],
+ "has_island": ["any", ["==", ["get", "featureclass"], "island"]]
+ }
})JSON", error);
// GeoJSON-VT
@@ -63,4 +69,8 @@ TEST(GeoJSONOptions, FullConversion) {
ASSERT_EQ(converted.cluster, true);
ASSERT_EQ(converted.clusterRadius, 4);
ASSERT_EQ(converted.clusterMaxZoom, 5);
+ ASSERT_EQ(converted.clusterProperties.size(), 3);
+ ASSERT_EQ(converted.clusterProperties.count("max"), 1);
+ ASSERT_EQ(converted.clusterProperties.count("sum"), 1);
+ ASSERT_EQ(converted.clusterProperties.count("has_island"), 1);
}