#include #include #include #include #include using namespace mbgl; using namespace mbgl::style; TEST(GroupByLayout, Related) { std::vector> layers; layers.push_back(std::make_unique("a", "source")); layers.push_back(std::make_unique("b", "source")); auto result = groupByLayout(std::move(layers)); ASSERT_EQ(1u, result.size()); ASSERT_EQ(2u, result[0].size()); } TEST(GroupByLayout, UnrelatedType) { std::vector> layers; layers.push_back(std::make_unique("background")); layers.push_back(std::make_unique("circle", "source")); auto result = groupByLayout(std::move(layers)); ASSERT_EQ(2u, result.size()); } TEST(GroupByLayout, UnrelatedFilter) { std::vector> layers; layers.push_back(std::make_unique("a", "source")); layers.push_back(std::make_unique("b", "source")); layers[0]->as()->setFilter(EqualsFilter()); auto result = groupByLayout(std::move(layers)); ASSERT_EQ(2u, result.size()); } TEST(GroupByLayout, UnrelatedLayout) { std::vector> layers; layers.push_back(std::make_unique("a", "source")); layers.push_back(std::make_unique("b", "source")); layers[0]->as()->setLineCap(LineCapType::Square); auto result = groupByLayout(std::move(layers)); ASSERT_EQ(2u, result.size()); }