diff options
author | Andy Shaw <andy.shaw@digia.com> | 2012-01-16 21:12:21 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-01-17 15:59:48 (GMT) |
commit | 7ce3726aea4be2dfdb57966a4482f66fec6f8f57 (patch) | |
tree | 32c0149772999b8bfd341ddb3fd9e71b4d09ca30 /tests | |
parent | 181456d0a31b7250da97eafba75e6bc657391777 (diff) | |
download | Qt-7ce3726aea4be2dfdb57966a4482f66fec6f8f57.zip Qt-7ce3726aea4be2dfdb57966a4482f66fec6f8f57.tar.gz Qt-7ce3726aea4be2dfdb57966a4482f66fec6f8f57.tar.bz2 |
Fix a couple of edge cases for WildcardUnix matching
Fix a couple of cases where WildcardUnix was not matching when the
string was just [] or ended with a \.
The testWildcardEscaping() test has been extended to account for these
two cases too.
Task-number: QTBUG-20897
Change-Id: I9ddb10f5a1150427e8ccefae0dc87a3d4e104854
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qregexp/tst_qregexp.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/auto/qregexp/tst_qregexp.cpp b/tests/auto/qregexp/tst_qregexp.cpp index 6a4b38e..d444558 100644 --- a/tests/auto/qregexp/tst_qregexp.cpp +++ b/tests/auto/qregexp/tst_qregexp.cpp @@ -938,6 +938,8 @@ void tst_QRegExp::testEscapingWildcard_data(){ QTest::newRow("? Escaped") << "\\?O;" << "?O;" << true; QTest::newRow("[] not escaped") << "[lL]" << "l" << true; + QTest::newRow("[] escaped") << "\\[\\]" << "[]" << true; + QTest::newRow("case [[]") << "[[abc]" << "[" << true; QTest::newRow("case []abc] match ]") << "[]abc]" << "]" << true; QTest::newRow("case []abc] match a") << "[]abc]" << "a" << true; @@ -953,7 +955,7 @@ void tst_QRegExp::testEscapingWildcard_data(){ QTest::newRow("a true '\\' in input") << "\\Qt;" << "\\Qt;" << true; QTest::newRow("two true '\\' in input") << "\\\\Qt;" << "\\\\Qt;" << true; - QTest::newRow("a '\\' at the end") << "\\\\Qt;" << "\\\\Qt;" << true; + QTest::newRow("a '\\' at the end") << "\\\\Qt;\\" << "\\\\Qt;\\" << true; } void tst_QRegExp::testEscapingWildcard(){ |