summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-05-09 11:57:12 +0200
committerEdward Welbourne <edward.welbourne@qt.io>2023-05-22 17:09:07 +0200
commit11dc0747201cb560d3f507a4c4f40e8402bd31f2 (patch)
tree24e9d8b64a3d7b2b46286b9cb8a308f9bd3a02e5 /tests
parent457dc2c47bd77ecb11b67538c5fbff8e54a386b3 (diff)
Fix case-sensitivity of exponent separator check in Cyrillic fall-back
This is a back-port to 6.5 of both the special-case handling of Cyrillic's exponent separator [0] and the fix to that, that prompted this cherry-pick. Both changes were made after significant restructuring of relevant code to cope with multi-character exponent separators, which is not backported to 6.5. [0] commit cb54da236662563bfdc2f58a01320c3bd360cbff Added some test-cases for the lower-case exponential separator. Fixes: QTBUG-113443 Change-Id: I18e22d7b3451fbb61e87d5b93661eadff3c7356e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> (cherry picked from commit 4768fcf836f1eb0f59ab62a29eb821b433a239c1) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/text/qlocale/tst_qlocale.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
index a5b5e983b8..d3e4320709 100644
--- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
+++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp
@@ -871,6 +871,18 @@ void tst_QLocale::toReal_data()
<< u"fa_IR"_s << u"\u06f4\u00d7\u200e\u2212\u06f0\u06f3"_s << false << 0.0;
QTest::newRow("fa_IR 4x!3") // Only first character of exponent and sign
<< u"fa_IR"_s << u"\u06f4\u00d7\u200e\u06f0\u06f3"_s << false << 0.0;
+
+ // Cyrillic has its own E; only officially used by Ukrainian as exponent,
+ // with other Cyrillic locales using the Latin E. QLocale allows that there
+ // may be some cross-over between these.
+ QTest::newRow("uk_UA Cyrillic E") << u"uk_UA"_s << u"4\u0415-3"_s << true << 4e-3; // Official
+ QTest::newRow("uk_UA Latin E") << u"uk_UA"_s << u"4E-3"_s << true << 4e-3;
+ QTest::newRow("uk_UA Cyrilic e") << u"uk_UA"_s << u"4\u0435-3"_s << true << 4e-3;
+ QTest::newRow("uk_UA Latin e") << u"uk_UA"_s << u"4e-3"_s << true << 4e-3;
+ QTest::newRow("ru_RU Latin E") << u"ru_RU"_s << u"4E-3"_s << true << 4e-3; // Official
+ QTest::newRow("ru_RU Cyrillic E") << u"ru_RU"_s << u"4\u0415-3"_s << true << 4e-3;
+ QTest::newRow("ru_RU Latin e") << u"ru_RU"_s << u"4e-3"_s << true << 4e-3;
+ QTest::newRow("ru_RU Cyrilic e") << u"ru_RU"_s << u"4\u0435-3"_s << true << 4e-3;
}
#define EXPECT_NONSINGLE_FAILURES do { \
QEXPECT_FAIL("sv_SE 4e-3", "Code wrongly assumes single character, QTBUG-107801", Abort); \