diff options
Diffstat (limited to 'tests/auto/qregexp/tst_qregexp.cpp')
-rw-r--r-- | tests/auto/qregexp/tst_qregexp.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qregexp/tst_qregexp.cpp b/tests/auto/qregexp/tst_qregexp.cpp index d0d26ee..52f2041 100644 --- a/tests/auto/qregexp/tst_qregexp.cpp +++ b/tests/auto/qregexp/tst_qregexp.cpp @@ -77,6 +77,7 @@ private slots: void caretAnchoredOptimization(); void isEmpty(); void prepareEngineOptimization(); + void swap(); void operator_eq(); /* @@ -1290,6 +1291,14 @@ void tst_QRegExp::prepareEngineOptimization() QCOMPARE(rx11.matchedLength(), -1); } +void tst_QRegExp::swap() +{ + QRegExp r1(QLatin1String(".*")), r2(QLatin1String("a*")); + r1.swap(r2); + QCOMPARE(r1.pattern(),QLatin1String("a*")); + QCOMPARE(r2.pattern(),QLatin1String(".*")); +} + void tst_QRegExp::operator_eq() { const int I = 2; |