mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
More test for referencedVariables
This commit is contained in:
parent
25e983436d
commit
6d387650f4
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user