summaryrefslogtreecommitdiff
path: root/test/util/merge_lines.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/util/merge_lines.test.cpp')
-rw-r--r--test/util/merge_lines.test.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/util/merge_lines.test.cpp b/test/util/merge_lines.test.cpp
index 4856a734fe..9a8f01ef35 100644
--- a/test/util/merge_lines.test.cpp
+++ b/test/util/merge_lines.test.cpp
@@ -76,3 +76,27 @@ TEST(MergeLines, CircularLines) {
EXPECT_TRUE(input3[i].geometry == expected3[i].geometry);
}
}
+
+TEST(MergeLines, EmptyOuterGeometry) {
+ std::vector<mbgl::SymbolFeature> input = {
+ { FeatureType::LineString, {}, aaa, {}, 0 },
+ };
+
+ const std::vector<mbgl::SymbolFeature> expected = input;
+
+ mbgl::util::mergeLines(input);
+
+ EXPECT_EQ(expected[0].geometry, input[0].geometry);
+}
+
+TEST(MergeLines, EmptyInnerGeometry) {
+ std::vector<mbgl::SymbolFeature> input = {
+ { FeatureType::LineString, {{}}, aaa, {}, 0 },
+ };
+
+ const std::vector<mbgl::SymbolFeature> expected = input;
+
+ mbgl::util::mergeLines(input);
+
+ EXPECT_EQ(expected[0].geometry, input[0].geometry);
+}