qt5base-lts/tests/auto/corelib/text
Edward Welbourne 300aaec2f9 Fix digit grouping when digits are surrogat pairs
This is a follow-up to commit ed2b110b6a
to fix indexing errors. Added the test that should have accompanied
that commit, which found some bugs, and refined the Indian number
formatting test (on which it's based).

Make variable i in the loops that insert grouping characters in a
number be consistently a *character* offset - which, when each digit
is a surrogate pair, isn't the same as an index into the
QString. Apply the needed scaling when indexing with it, not when
setting it or decrementing it. Don't assume the separator has the same
width as a digit.

Differences in index no longer give the number of digits between two
points in a string, so actively track how many digits we've seen in a
group when converting a numeric string to the C locale. Partially
cleaned up the code for that in the process (more shall follow when I
sort out digit grouping properly, without special-casing India).

Change-Id: I13d0f24efa26e599dfefb5733e062088fa56d375
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-17 13:43:50 +02:00
..
qbytearray Merge remote-tracking branch 'origin/5.15' into dev 2019-12-09 10:16:01 +01:00
qbytearraylist Regenerate tests/auto/corelib/text 2019-11-12 17:26:05 +00:00
qbytearraymatcher Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00
qbytedatabuffer Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qchar Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00
qcollator Make QLocale(QString) explicit 2020-04-01 09:29:26 +01:00
qlatin1string Deprecate QStringViewLiteral 2019-08-10 22:13:49 +02:00
qlocale Fix digit grouping when digits are surrogat pairs 2020-04-17 13:43:50 +02:00
qregexp Regenerate tests/auto/corelib/text 2019-11-12 17:26:05 +00:00
qregularexpression QRegularExpression: rename AnchoredMatchOption to AnchorAtOffsetMatchOption 2020-04-03 21:49:57 +02:00
qstring Remove QString::from/toAscii() 2020-04-16 23:14:57 +02:00
qstring_no_cast_from_bytearray Regenerate tests/auto/corelib/text 2019-11-12 17:26:05 +00:00
qstringapisymmetry tst_qstringapisymmetry: start testing char16_t, too 2020-03-05 10:51:39 +03:00
qstringbuilder Regenerate tests/auto/corelib/text 2019-11-12 17:26:05 +00:00
qstringiterator Regenerate projects one last time before merge 2020-02-12 17:30:49 +00:00
qstringlist Regenerate tests/auto/corelib/text 2019-11-12 17:26:05 +00:00
qstringmatcher Regenerate tests/auto/corelib/text 2019-11-12 17:26:05 +00:00
qstringref Make QLocale(QString) explicit 2020-04-01 09:29:26 +01:00
qstringview QStringView: add a test for overload resolution versus QString 2020-01-09 00:01:55 +01:00
qtextboundaryfinder Update UCD to Revision 26 2020-03-14 11:26:59 +01:00
CMakeLists.txt Merge branch 'wip/qt6' into wip/cmake 2019-08-15 16:53:19 +02:00
text.pro Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00