Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test "substr" function with named parameters
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Jul 21, 2021
1 parent d3dade0 commit fdbbdeb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/src/core/testqgsexpression.cpp
Expand Up @@ -1335,6 +1335,7 @@ class TestQgsExpression: public QObject
QTest::newRow( "regexp_replace cap group" ) << "regexp_replace('HeLLo','(eL)', 'x\\\\1x')" << false << QVariant( "HxeLxLo" );
QTest::newRow( "regexp_replace invalid" ) << "regexp_replace('HeLLo','[[[', '-')" << true << QVariant();
QTest::newRow( "substr" ) << "substr('HeLLo', 3,2)" << false << QVariant( "LL" );
QTest::newRow( "substr named parameters" ) << "substr(string:='HeLLo',start:=3,length:=2)" << false << QVariant( "LL" );
QTest::newRow( "substr negative start" ) << "substr('HeLLo', -4)" << false << QVariant( "eLLo" );
QTest::newRow( "substr negative length" ) << "substr('HeLLo', 1,-3)" << false << QVariant( "He" );
QTest::newRow( "substr positive start and negative length" ) << "substr('HeLLo', 3,-1)" << false << QVariant( "LL" );
Expand Down

0 comments on commit fdbbdeb

Please sign in to comment.