qt5base-lts/tests/auto/corelib/text
Giuseppe D'Angelo f0c2c987e3 QBA(V)/QS(V)::lastIndexOf: fix the search of 1-char needles
When a needle has length 1 (because it's a QChar/char16_t, or because
it's a string-like of length 1) then an ad-hoc search algorithm is
used. This algorithm had a off-by-one, by not allowing to match at
the last position of a haystack (in case `from` was `haystack.size()`).

That is inconsistent with the general search of substring needles
(and what QByteArray does). Fix that case and amend wrong tests.
This in turn unveiled the fact that the algorithm was unable to cope
with 0-length haystacks (whops), so fix that as well. Drive-by, add a
similar fix for QByteArray.

Amends 6cee204d56.

Pick-to: 6.2
Change-Id: I6b3effc4ecd74bcbcd33dd2e550da2df7bf05ae3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-08-26 07:08:34 +02:00
..
qbytearray Improve and simplify tst_QByteArray's tests 2021-08-19 15:06:49 +02:00
qbytearrayapisymmetry QS(V)/QBA(V)/QL1S::lastIndexOf: fix the offset calculations 2021-08-19 01:55:01 +02:00
qbytearraylist Remove the qmake project files 2021-01-07 15:32:28 +01:00
qbytearraymatcher Remove the qmake project files 2021-01-07 15:32:28 +01:00
qbytearrayview Add QByteArrayView::trimmed() 2021-08-11 22:32:42 +02:00
qbytedatabuffer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qchar Hangul composition: use < base + count checks, not <= checks 2021-06-11 13:57:19 +02:00
qcollator Mark variables that might be unused under some configurations 2021-04-11 19:53:43 +02:00
qlatin1string QLatin1String: Add a constructor taking QByteArrayView 2021-06-12 03:08:59 +02:00
qlocale tst_QLocale::formatTime(): add some actual locale-dependence 2021-08-18 21:31:30 +02:00
qregularexpression QRegularExpressionMatch: add a way to know if a capturing group captured 2021-08-25 00:06:42 +02:00
qstring QBA(V)/QS(V)::lastIndexOf: fix the search of 1-char needles 2021-08-26 07:08:34 +02:00
qstring_no_cast_from_bytearray testlib: Deprecate QWARN() in favor of qWarning() 2021-08-04 19:31:51 +02:00
qstringapisymmetry QBA(V)/QS(V)::lastIndexOf: fix the search of 1-char needles 2021-08-26 07:08:34 +02:00
qstringbuilder Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringconverter Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringiterator Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringlist Ensure test using setlocale() doesn't leave it permanently changed 2021-06-12 00:03:53 +02:00
qstringmatcher Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringtokenizer Remove the qmake project files 2021-01-07 15:32:28 +01:00
qstringview Remove the qmake project files 2021-01-07 15:32:28 +01:00
qtextboundaryfinder Unicode: fix the grapheme clustering algorithm 2021-08-24 12:58:20 +02:00
shared QString/QByteArray::number(double): Test big numbers 2021-08-17 03:53:45 +02:00
CMakeLists.txt Android: blacklist a list of failing tests for android 2020-11-04 12:27:49 +02:00