diff options
Diffstat (limited to 'tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp')
-rw-r--r-- | tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp index a986223a87..dd96b158f4 100644 --- a/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp +++ b/tests/auto/corelib/text/qregularexpression/tst_qregularexpression.cpp @@ -184,6 +184,27 @@ bool operator==(const QRegularExpressionMatchIterator &iterator, const QList<Mat if (i.hasNext()) return false; + i = iterator; + + int index = 0; + for (const QRegularExpressionMatch &match : i) { + if (match != expectedMatchList[index++]) + return false; + } + + if (index != expectedMatchList.size()) + return false; + + // do it again + index = 0; + for (const QRegularExpressionMatch &match : i) { + if (match != expectedMatchList[index++]) + return false; + } + + if (index != expectedMatchList.size()) + return false; + return true; } |