Skip to content

Commit 269d884

Browse files
roya0045nyalldawson
authored andcommittedFeb 23, 2022
test with keywords
1 parent bb3c696 commit 269d884

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
 

‎tests/src/core/testqgsexpression.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2326,14 +2326,14 @@ class TestQgsExpression: public QObject
23262326
QTest::newRow( "get_feature 1" ) << "get_feature('test','col1',10)" << true << 1;
23272327
QTest::newRow( "get_feature 2" ) << "get_feature('test','col2','test1')" << true << 1;
23282328
QTest::newRow( "get_feature 3" ) << "get_feature('test','col1',11)" << true << 2;
2329-
QTest::newRow( "get_feature 4" ) << "get_feature('test','col2','test2')" << true << 2;
2329+
QTest::newRow( "get_feature 4" ) << "get_feature('test',attribute:= 'col2',value:='test2')" << true << 2;
23302330
QTest::newRow( "get_feature 5" ) << "get_feature('test','col1',3)" << true << 3;
23312331
QTest::newRow( "get_feature 6" ) << "get_feature('test','col2','test3')" << true << 3;
2332-
QTest::newRow( "get_feature 7" ) << "get_feature('test','col1',41)" << true << 4;
2332+
QTest::newRow( "get_feature 7" ) << "get_feature('test',attribute:= 'col1',value:= 41)" << true << 4;
23332333
QTest::newRow( "get_feature 8" ) << "get_feature('test','col2','test4')" << true << 4;
23342334

23352335
//by layer id
2336-
QTest::newRow( "get_feature 3" ) << QStringLiteral( "get_feature('%1','col1',11)" ).arg( mMemoryLayer->id() ) << true << 2;
2336+
QTest::newRow( "get_feature 3" ) << QStringLiteral( "get_feature('%1',attribute:= 'col1',value:= 11)" ).arg( mMemoryLayer->id() ) << true << 2;
23372337
QTest::newRow( "get_feature 4" ) << QStringLiteral( "get_feature('%1','col2','test2')" ).arg( mMemoryLayer->id() ) << true << 2;
23382338

23392339
//no matching features
@@ -2346,12 +2346,12 @@ class TestQgsExpression: public QObject
23462346
QTest::newRow( "get_feature_by_id" ) << "get_feature_by_id('test', 1)" << true << 1;
23472347

23482348
// multi-param
2349-
QTest::newRow( "get_feature multi1" ) << "get_feature('test',map('col1','11','col2','test2'))" << true << 2;
2350-
QTest::newRow( "get_feature multi2" ) << "get_feature('test',map('col1',3,'col2','test3'))" << true << 3;
2349+
QTest::newRow( "get_feature multi1" ) << "get_feature('test',attribute:= map('col1','11','col2','test2'))" << true << 2;
2350+
QTest::newRow( "get_feature multi2" ) << "get_feature('test',attribute:= map('col1',3,'col2','test3'))" << true << 3;
23512351
QTest::newRow( "get_feature multi2" ) << "get_feature('test',map('col1','41','datef',to_date('2022-09-23')))" << true << 4;
23522352

23532353
// multi-param no match
2354-
QTest::newRow( "get_feature no match-multi1" ) << "get_feature('test',map('col1','col2'),'no match!')" << false << -1;
2354+
QTest::newRow( "get_feature no match-multi1" ) << "get_feature('test',attribute:= map('col1','col2'),value:='no match!')" << false << -1;
23552355
QTest::newRow( "get_feature no match-multi2" ) << "get_feature('test',map('col2','10','col4','test3'))" << false << -1;
23562356
QTest::newRow( "get_feature no match-multi2" ) << "get_feature('test',map('col1',10,'datef',to_date('2021-09-24')))" << false << -1;
23572357

0 commit comments

Comments
 (0)
Please sign in to comment.