diff options
author | Liang Qi <liang.qi@qt.io> | 2017-02-08 15:48:29 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-02-08 15:49:18 +0100 |
commit | dd756011da13b95fdb630a1bbb90234f1e60f415 (patch) | |
tree | a6259b1e9b6463108796ce912e3d1752e301505f /tests/auto/corelib/tools | |
parent | 0c50edbe84914469973a3b10e0170023ccdd66fe (diff) | |
parent | b6bf2a33f4c33a212da7b58a049b3b5b20b3f327 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
configure.json
mkspecs/win32-icc/qmake.conf
Change-Id: Ibf40546b024d644c7d9ed490bee15b82597f4d3f
Diffstat (limited to 'tests/auto/corelib/tools')
-rw-r--r-- | tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp index 0c098cb1c3..8a55f54449 100644 --- a/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp +++ b/tests/auto/corelib/tools/qstringmatcher/tst_qstringmatcher.cpp @@ -54,12 +54,21 @@ void tst_QStringMatcher::qstringmatcher() // public Qt::CaseSensitivity caseSensitivity() const void tst_QStringMatcher::caseSensitivity() { - QStringMatcher matcher; + const QString haystack = QStringLiteral("foobarFoo"); + const QStringRef needle = haystack.rightRef(3); // "Foo" + QStringMatcher matcher(needle.data(), needle.size()); - matcher.setCaseSensitivity(Qt::CaseSensitive); QCOMPARE(matcher.caseSensitivity(), Qt::CaseSensitive); + QCOMPARE(matcher.indexIn(haystack), 6); + matcher.setCaseSensitivity(Qt::CaseInsensitive); + QCOMPARE(matcher.caseSensitivity(), Qt::CaseInsensitive); + QCOMPARE(matcher.indexIn(haystack), 0); + + matcher.setCaseSensitivity(Qt::CaseSensitive); + QCOMPARE(matcher.caseSensitivity(), Qt::CaseSensitive); + QCOMPARE(matcher.indexIn(haystack), 6); } void tst_QStringMatcher::indexIn_data() |