qt5base-lts/tests/auto/corelib/tools/qregularexpression
Giuseppe D'Angelo ee15bef3ea QRegularExpression: fix matching over QStringRefs
Playing with the offset argument of pcre_exec is not equivalent to
adjusting the pointer to the subject string. In particular, PCRE
can go behind the offset to check for lookbehinds or "transition"
metacharacters (\b, \B, etc.).

This made the code that deals with QStringRefs not matching in behavior
with the corresponding code dealing with QStrings. For instance,

   QString subject("Miss");
   QRegularExpression re("(?<=M)iss");
   re.match(subject.mid(1));           // doesn't match
   re.match(subject.midRef(1));        // matches!!!

Instead, actually adjust the pointer to the subject string so that
the behavior is identical. A broken test that relied on the
equivalence is also removed.

Change-Id: If96333241ef59621d7f5a6a170ebd0a186844874
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-08-18 14:18:48 +00:00
..
alwaysoptimize Update copyright headers 2015-02-11 06:49:51 +00:00
defaultoptimize Update copyright headers 2015-02-11 06:49:51 +00:00
forceoptimize Update copyright headers 2015-02-11 06:49:51 +00:00
.gitignore QRegularExpression: add ways to force an immediate optimization 2014-05-06 00:10:55 +02:00
qregularexpression.pro QRegularExpression: add ways to force an immediate optimization 2014-05-06 00:10:55 +02:00
tst_qregularexpression.cpp QRegularExpression: fix matching over QStringRefs 2015-08-18 14:18:48 +00:00
tst_qregularexpression.h QRegularExpression: fix matching over QStringRefs 2015-08-18 14:18:48 +00:00