Skip to content
Permalink
Browse files

More test for referencedVariables

  • Loading branch information
m-kuhn committed Oct 31, 2016
1 parent 25e9834 commit 6d387650f4b41f55393acb2747466dcbcaa38645
Showing with 8 additions and 2 deletions.
  1. +8 −2 tests/src/core/testqgsexpression.cpp
@@ -1578,8 +1578,14 @@ class TestQgsExpression: public QObject
void referenced_variables()
{
QSet<QString> 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<QString> refVar = exp.referencedVariables();

0 comments on commit 6d38765

Please sign in to comment.
You can’t perform that action at this time.