Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Aug 23, 2018
1 parent db99c77 commit 61faf79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/core/testqgsexpression.cpp
Expand Up @@ -2691,8 +2691,8 @@ class TestQgsExpression: public QObject
foreachExpected << QStringLiteral( "ABC" ) << QStringLiteral( "HELLO" );
QCOMPARE( QgsExpression( "array_foreach(array('abc', 'hello'), upper(@element))" ).evaluate( &context ), QVariant( foreachExpected ) );

QVariantList filterExpected() << QStringLiteral( "A: a" ) << QStringLiteral( "A: d" );
QCOMPARE( QgsExpression( "array_filter(array('A: a', 'B: b', 'C: c', 'A: d'), substr(@element, 1, 2) = 'A:')" ).evaluate( &context ), QVariant( filterExpected ) );
QVariantList filterExpected = QVariantList() << QStringLiteral( "A: a" ) << QStringLiteral( "A: d" );
QCOMPARE( QgsExpression( "array_filter(array(array:='A: a', 'B: b', 'C: c', 'A: d'), expression:=substr(@element, 1, 2) = 'A:')" ).evaluate( &context ), QVariant( filterExpected ) );

QCOMPARE( QgsExpression( "array_intersect(array('1', '2', '3', '4'), array('4', '0', '2', '5'))" ).evaluate( &context ), QVariant( true ) );
QCOMPARE( QgsExpression( "array_intersect(array('1', '2', '3', '4'), array('0', '5'))" ).evaluate( &context ), QVariant( false ) );
Expand Down Expand Up @@ -2777,7 +2777,7 @@ class TestQgsExpression: public QObject
foreachExpected << 10 << 20 << 40;
QCOMPARE( QgsExpression( "array_foreach(array(1, 2, 4), @element * 10)" ).evaluate( &context ), QVariant( foreachExpected ) );

QVariantList filterExpected() << 1 << 2;
QVariantList filterExpected = QVariantList() << 1 << 2;
QCOMPARE( QgsExpression( "array_filter(array(1, 2, 4), @element < 3)" ).evaluate( &context ), QVariant( filterExpected ) );

QgsExpression badArray( QStringLiteral( "array_get('not an array', 0)" ) );
Expand Down

0 comments on commit 61faf79

Please sign in to comment.