diff options
author | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-11-12 22:21:12 +0200 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2019-12-02 17:11:49 +0200 |
commit | a01ecc92a079cb488d5f24d374d82e5fc34fe14b (patch) | |
tree | c3052da141be941a9dfa3d8aa1302b5cf678841d /test/style | |
parent | 5e3ef2e9e06afb2150b0977dbb2a1ef8e6ad2848 (diff) | |
download | qtlocation-mapboxgl-a01ecc92a079cb488d5f24d374d82e5fc34fe14b.tar.gz |
[core] Add image sections to format expression
Diffstat (limited to 'test/style')
-rw-r--r-- | test/style/style_layer.test.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/style/style_layer.test.cpp b/test/style/style_layer.test.cpp index 2d6ef5881a..1d60197c2d 100644 --- a/test/style/style_layer.test.cpp +++ b/test/style/style_layer.test.cpp @@ -343,7 +343,8 @@ void testHasOverrides(LayoutType& layout) { EXPECT_FALSE(MockOverrides::hasOverrides(layout.template get<TextField>())); // Expression, overridden text-color. - FormatExpressionSection section(literal(""), nullopt, nullopt, toColor(literal("red"))); + FormatExpressionSection section(literal("")); + section.setTextSectionOptions(nullopt, nullopt, toColor(literal("red"))); auto formatExprOverride = std::make_unique<FormatExpression>(std::vector<FormatExpressionSection>{section}); PropertyExpression<Formatted> propExprOverride(std::move(formatExprOverride)); layout.template get<TextField>() = PropertyValueType<Formatted>(std::move(propExprOverride)); @@ -351,7 +352,9 @@ void testHasOverrides(LayoutType& layout) { // Nested expressions, overridden text-color. auto formattedExpr1 = format("first paragraph"); - std::vector<FormatExpressionSection> sections{ { literal("second paragraph"), nullopt, nullopt, toColor(literal("blue")) } }; + FormatExpressionSection secondParagraph(literal("second paragraph")); + secondParagraph.setTextSectionOptions(nullopt, nullopt, toColor(literal("blue"))); + std::vector<FormatExpressionSection> sections{{std::move(secondParagraph)}}; auto formattedExpr2 = std::make_unique<FormatExpression>(std::move(sections)); std::unordered_map<std::string, std::shared_ptr<Expression>> branches{ { "1st", std::move(formattedExpr1) }, { "2nd", std::move(formattedExpr2) } }; |