Extend tst_QByteArray::replaceWithEmptyNeedleInsertsBeforeEachChar()
Add rows with needles and haystacks whole length is > 1 (to avoid only hitting paths that use single-char matching). Amends 5fc1e9fa0c1925654412af5bf46ff95da99bc190. Pick-to: 6.9 6.8 6.5 Reported-by: Ahman Samir <a.samirh78@gmail.com> Change-Id: Ie4c695f54d84cdb56b93fee6b7224d93faf00f75 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
This commit is contained in:
parent
9b849eea41
commit
b83f104889
@ -1557,7 +1557,9 @@ void tst_QByteArray::replaceWithEmptyNeedleInsertsBeforeEachChar_data()
|
||||
const QByteArray a = "a";
|
||||
const QByteArray aa = "aa";
|
||||
const QByteArray b = "b";
|
||||
const QByteArray bb = "bb";
|
||||
const QByteArray bab = "bab";
|
||||
const QByteArray babab = "babab";
|
||||
|
||||
auto row = [](const QByteArray &haystack, const QByteArray &needle,
|
||||
const QByteArray &replacement, const QByteArray &result)
|
||||
@ -1569,12 +1571,23 @@ void tst_QByteArray::replaceWithEmptyNeedleInsertsBeforeEachChar_data()
|
||||
row(null, null, a, a);
|
||||
row(null, empty, a, a);
|
||||
row(null, a, a, null);
|
||||
row(null, a, b, null);
|
||||
row(null, aa, b, null);
|
||||
|
||||
row(empty, null, a, a);
|
||||
row(empty, empty, a, a);
|
||||
row(empty, a, a, empty);
|
||||
row(empty, aa, b, empty);
|
||||
|
||||
row(a, null, b, bab);
|
||||
row(a, empty, b, bab);
|
||||
row(a, a, b, b);
|
||||
row(a, aa, b, a);
|
||||
|
||||
row(aa, null, b, babab);
|
||||
row(aa, empty, b, babab);
|
||||
row(aa, a, b, bb);
|
||||
row(aa, aa, b, b);
|
||||
}
|
||||
|
||||
void tst_QByteArray::replaceWithEmptyNeedleInsertsBeforeEachChar()
|
||||
|
Loading…
x
Reference in New Issue
Block a user