summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/util
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@theqtcompany.com>2014-11-10 12:53:31 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2014-11-20 14:58:39 +0100
commit71ed74e72e4d3c643381fa1b4a276c0609393df2 (patch)
treee0049228abfaeeed856dd1c6b73f8525e1b3462b /tests/auto/gui/util
parent41db4b8cdc231eaeef9d1bb144f134901c45a2ef (diff)
Allow empty string as intermediate match
QRegularExpressionValidator and QRegularExpression disagree on what a partial match means. [ChangeLog][QtGui][QRegularExpressionValidator] Allow empty string as intermediate match Change-Id: Ia6c55beb54870b1be5c88b6ef3eceebc8ca3f86b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'tests/auto/gui/util')
-rw-r--r--tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp b/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp
index 31853f7015..eff07ad07f 100644
--- a/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp
+++ b/tests/auto/gui/util/qregularexpressionvalidator/tst_qregularexpressionvalidator.cpp
@@ -74,6 +74,9 @@ void tst_QRegularExpressionValidator::validate_data()
QTest::newRow("data14") << QRegularExpression("\\w\\d\\d") << QString("E5") << QValidator::Intermediate;
QTest::newRow("data15") << QRegularExpression("\\w\\d\\d") << QString("+9") << QValidator::Invalid;
+ QTest::newRow("emptystr1") << QRegularExpression("[T][e][s][t]") << QString("") << QValidator::Intermediate;
+ QTest::newRow("emptystr2") << QRegularExpression("[T][e][s][t]") << QString() << QValidator::Intermediate;
+
QTest::newRow("empty01") << QRegularExpression() << QString() << QValidator::Acceptable;
QTest::newRow("empty02") << QRegularExpression() << QString("test") << QValidator::Acceptable;
}