summaryrefslogtreecommitdiff
path: root/test/style/property_expression.test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/style/property_expression.test.cpp')
-rw-r--r--test/style/property_expression.test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/style/property_expression.test.cpp b/test/style/property_expression.test.cpp
index e4ee5f115f..a7d1d25660 100644
--- a/test/style/property_expression.test.cpp
+++ b/test/style/property_expression.test.cpp
@@ -121,3 +121,17 @@ TEST(PropertyExpression, Issue8460) {
EXPECT_NEAR(600.0f, fn2.evaluate(18.0f, oneInteger, -1.0f), 0.00);
EXPECT_NEAR(600.0f, fn2.evaluate(19.0f, oneInteger, -1.0f), 0.00);
}
+
+TEST(PropertyExpression, TextSection) {
+ expression::Value formattedSection1 = 42.0;
+ PropertyExpression<double> ts1(textSection());
+ EXPECT_DOUBLE_EQ(42.0, ts1.evaluate(expression::EvaluationContext().withFormattedSection(&formattedSection1)));
+
+ expression::Value formattedSection2{"header"s};
+ PropertyExpression<std::string> ts2(textSection());
+ EXPECT_EQ("header"s, ts2.evaluate(expression::EvaluationContext().withFormattedSection(&formattedSection2)));
+
+ // Evaluates to default, T().
+ PropertyExpression<Color> ts3(textSection());
+ EXPECT_EQ(Color(), ts3.evaluate(expression::EvaluationContext().withFormattedSection(&formattedSection1)));
+}