diff options
author | Andreas Buhr <andreas.buhr@qt.io> | 2020-11-19 13:07:17 +0100 |
---|---|---|
committer | Andreas Buhr <andreas.buhr@qt.io> | 2020-11-20 14:42:49 +0100 |
commit | 7b0fd207756d367db768c3cb546fa439c15bbac8 (patch) | |
tree | 56560626ba6af0944ed83e8ede9d3436a672043a /tests/auto/corelib/text/qstring | |
parent | 756c4faccbe3ae583193e8706dc0c99d39d3dcb8 (diff) |
Add unit test for QString::insert(negativeint, QChar)
QString::insert(qsizetype, QChar) can insert at negative positions,
then counting from the end of the string. Coverage analysis revealed we
do not have a unit test for this. This patch adds a unit test.
Pick-to: 6.0
Change-Id: I8d41b38df964c07fe2d2e7be444f8236c9e19b5d
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Diffstat (limited to 'tests/auto/corelib/text/qstring')
-rw-r--r-- | tests/auto/corelib/text/qstring/tst_qstring.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp index ab118deb90..04a4469a7d 100644 --- a/tests/auto/corelib/text/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp @@ -2384,6 +2384,7 @@ void tst_QString::insert_special_cases() QCOMPARE(a.insert(1,'e'), QString("Yes")); QCOMPARE(a.insert(3,'!'), QString("Yes!")); QCOMPARE(a.insert(5,'?'), QString("Yes! ?")); + QCOMPARE(a.insert(-1,'a'), QString("Yes! a?")); a = "ABC"; QCOMPARE(a.insert(5,"DEF"), QString("ABC DEF")); |