Skip to content

Commit 61faf79

Browse files
committed
Test fixes
1 parent db99c77 commit 61faf79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/src/core/testqgsexpression.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,8 +2691,8 @@ class TestQgsExpression: public QObject
26912691
foreachExpected << QStringLiteral( "ABC" ) << QStringLiteral( "HELLO" );
26922692
QCOMPARE( QgsExpression( "array_foreach(array('abc', 'hello'), upper(@element))" ).evaluate( &context ), QVariant( foreachExpected ) );
26932693

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

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

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

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

0 commit comments

Comments
 (0)