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 f4b518f commit c4313fdcefec04ca51480f3101d323e05c457bea
Showing with 1 addition and 0 deletions.
  1. +1 −0 tests/src/core/testqgsexpression.cpp
@@ -1318,6 +1318,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 c4313fd

Please sign in to comment.