@@ -2326,14 +2326,14 @@ class TestQgsExpression: public QObject
2326
2326
QTest::newRow ( " get_feature 1" ) << " get_feature('test','col1',10)" << true << 1 ;
2327
2327
QTest::newRow ( " get_feature 2" ) << " get_feature('test','col2','test1')" << true << 1 ;
2328
2328
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 ;
2330
2330
QTest::newRow ( " get_feature 5" ) << " get_feature('test','col1',3)" << true << 3 ;
2331
2331
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 ;
2333
2333
QTest::newRow ( " get_feature 8" ) << " get_feature('test','col2','test4')" << true << 4 ;
2334
2334
2335
2335
// 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 ;
2337
2337
QTest::newRow ( " get_feature 4" ) << QStringLiteral ( " get_feature('%1','col2','test2')" ).arg ( mMemoryLayer ->id () ) << true << 2 ;
2338
2338
2339
2339
// no matching features
@@ -2346,12 +2346,12 @@ class TestQgsExpression: public QObject
2346
2346
QTest::newRow ( " get_feature_by_id" ) << " get_feature_by_id('test', 1)" << true << 1 ;
2347
2347
2348
2348
// 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 ;
2351
2351
QTest::newRow ( " get_feature multi2" ) << " get_feature('test',map('col1','41','datef',to_date('2022-09-23')))" << true << 4 ;
2352
2352
2353
2353
// 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 ;
2355
2355
QTest::newRow ( " get_feature no match-multi2" ) << " get_feature('test',map('col2','10','col4','test3'))" << false << -1 ;
2356
2356
QTest::newRow ( " get_feature no match-multi2" ) << " get_feature('test',map('col1',10,'datef',to_date('2021-09-24')))" << false << -1 ;
2357
2357
0 commit comments