Skip to content
Permalink
Browse files
Test "substr" function with named parameters
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Jul 21, 2021
1 parent 9d67647 commit d382ef3ae7848a98bdf56a063d75f91ac08704d5
Showing with 1 addition and 0 deletions.
  1. +1 −0 tests/src/core/testqgsexpression.cpp
@@ -1339,6 +1339,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" );

0 comments on commit d382ef3

Please sign in to comment.