Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test for complex expression
  • Loading branch information
nyalldawson committed Jan 9, 2023
1 parent e4a842b commit 3735fe8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/src/core/testqgsexpression.cpp
Expand Up @@ -5708,6 +5708,13 @@ class TestQgsExpression: public QObject
QVERIFY( exp.prepare( &context ) );
QVERIFY( !exp.hasEvalError() );
QCOMPARE( exp.evaluate( &context ).toString(), QStringLiteral( "Raster" ) );

// complex expression
exp = QgsExpression( QStringLiteral( "with_variable('layer', load_layer('%1', 'gdal'), layer_property(@layer, 'type') || layer_property(@layer, 'type'))" ).arg( rasterFileName ) );
QVERIFY( exp.prepare( &context ) );
QVERIFY( !exp.hasEvalError() );
QCOMPARE( exp.evaluate( &context ).toString(), QStringLiteral( "RasterRaster" ) );

}

};
Expand Down

0 comments on commit 3735fe8

Please sign in to comment.