Skip to content

Commit

Permalink
[Test] QgsOgcUtils: Add ILIKE with wildcard tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rldhont committed Jul 8, 2019
1 parent c65bb14 commit de3b2be
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/src/core/testqgsogcutils.cpp
Expand Up @@ -394,6 +394,21 @@ void TestQgsOgcUtils::testExpressionFromOgcFilter_data()
"<PropertyName>NAME</PropertyName><Literal>*%QGIS*\\*</Literal></PropertyIsLike>"
"</Filter>" )
<< QStringLiteral( "NAME LIKE '%\\\\%QGIS%*'" );

QTest::newRow( "ilike wildCard simple" ) << QString(
"<Filter>"
"<PropertyIsLike matchCase=\"false\" wildCard='*' singleChar='.' escape=\"\\\">"
"<PropertyName>NAME</PropertyName><Literal>*QGIS*</Literal></PropertyIsLike>"
"</Filter>" )
<< QStringLiteral( "NAME ILIKE '%QGIS%'" );

QTest::newRow( "ilike wildCard complex" ) << QString(
"<Filter>"
"<PropertyIsLike matchCase=\"false\" wildCard='*' singleChar='.' escape=\"\\\">"
"<PropertyName>NAME</PropertyName><Literal>*%QGIS*\\*</Literal></PropertyIsLike>"
"</Filter>" )
<< QStringLiteral( "NAME ILIKE '%\\\\%QGIS%*'" );

// different single chars
QTest::newRow( "like single char" ) << QString(
"<Filter>"
Expand Down

0 comments on commit de3b2be

Please sign in to comment.