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. Change-Id: I8d41b38df964c07fe2d2e7be444f8236c9e19b5d Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 7b0fd207756d367db768c3cb546fa439c15bbac8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7a6f6fb20f
commit
4cb21ded95
@ -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"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user