From c21f95aab2228168452d1d7bb4e332a8c6164a02 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Tue, 10 Aug 2010 11:35:51 +0200 Subject: Added one test for QRegExp Task-number: QT-1289 --- tests/auto/qregexp/tst_qregexp.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/auto/qregexp/tst_qregexp.cpp b/tests/auto/qregexp/tst_qregexp.cpp index ea07323..d0d26ee 100644 --- a/tests/auto/qregexp/tst_qregexp.cpp +++ b/tests/auto/qregexp/tst_qregexp.cpp @@ -105,6 +105,7 @@ private slots: void QTBUG_7049_data(); void QTBUG_7049(); + void interval(); }; // Testing get/set functions @@ -1426,5 +1427,22 @@ void tst_QRegExp::QTBUG_7049() QCOMPARE( re.cap(2), cap2 ); } +void tst_QRegExp::interval() +{ + { + QRegExp exp("a{0,1}"); + QVERIFY(exp.isValid()); + } + { + QRegExp exp("a{1,1}"); + QVERIFY(exp.isValid()); + } + { + QRegExp exp("a{1,0}"); + QVERIFY(!exp.isValid()); + } +} + + QTEST_APPLESS_MAIN(tst_QRegExp) #include "tst_qregexp.moc" -- cgit v0.12