From 6d387650f4b41f55393acb2747466dcbcaa38645 Mon Sep 17 00:00:00 2001 From: Matthias Kuhn Date: Mon, 31 Oct 2016 14:24:34 +0100 Subject: [PATCH] More test for referencedVariables --- tests/src/core/testqgsexpression.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/src/core/testqgsexpression.cpp b/tests/src/core/testqgsexpression.cpp index 6f9ad7c4bf2..59b97ff88b1 100644 --- a/tests/src/core/testqgsexpression.cpp +++ b/tests/src/core/testqgsexpression.cpp @@ -1578,8 +1578,14 @@ class TestQgsExpression: public QObject void referenced_variables() { QSet expectedVars; - expectedVars << QStringLiteral( "foo" ) << QStringLiteral( "bar" ) << QStringLiteral( "ppp" ) << QStringLiteral( "qqq" ) << QStringLiteral( "rrr" ); - QgsExpression exp( QStringLiteral( "CASE WHEN intersects(@bar, $geometry) THEN @ppp ELSE @qqq * @rrr END + @foo IN (1, 2, 3)" ) ); + expectedVars << QStringLiteral( "foo" ) + << QStringLiteral( "bar" ) + << QStringLiteral( "ppp" ) + << QStringLiteral( "qqq" ) + << QStringLiteral( "rrr" ) + << QStringLiteral( "sss" ) + << QStringLiteral( "ttt" ); + QgsExpression exp( QStringLiteral( "CASE WHEN intersects(@bar, $geometry) THEN @ppp ELSE @qqq * @rrr END + @foo IN (1, 2, @sss) OR @ttt" ) ); QCOMPARE( exp.hasParserError(), false ); QSet refVar = exp.referencedVariables();