Skip to content
Permalink
Browse files

add test for searching for display expression in active layer locator…

… filter
  • Loading branch information
3nids committed Sep 21, 2020
1 parent 8d385be commit a509491e5c237b5e5d0e2ffd8b607529805d2a4b
Showing with 10 additions and 0 deletions.
  1. +10 −0 tests/src/app/testqgsapplocatorfilters.cpp
@@ -189,6 +189,16 @@ void TestQgsAppLocatorFilters::testSearchActiveLayer()
results = gatherResults( &filter, QStringLiteral( "@unknown_field nice" ), context );
QCOMPARE( results.count(), 0 );

// check with display expression, feature should not be shown twice
vl->setDisplayExpression( QStringLiteral( "concat(\"my_text\", ' ', \"my_double\")" ) );
results = gatherResults( &filter, QStringLiteral( "nice" ), context );
QCOMPARE( results.count(), 1 );
results = gatherResults( &filter, QStringLiteral( "a feature" ), context );
QCOMPARE( results.count(), 1 );
results = gatherResults( &filter, QStringLiteral( "nice .678" ), context );
QCOMPARE( results.count(), 1 );


QgsProject::instance()->removeAllMapLayers();
}

0 comments on commit a509491

Please sign in to comment.
You can’t perform that action at this time.