diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-03-05 09:11:11 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-03-12 05:32:41 +0000 |
commit | 5930a2d314d158f67bf3bf2bd940d7b67731ebde (patch) | |
tree | 54ba4bb14fd542ba0ce3d239a71d23b511551424 /tests/auto/corelib/tools/qstring/tst_qstring.cpp | |
parent | 718f87046a8fc2c0fb625dfc8641db0352ae9d92 (diff) |
Track modifications of white space in QString::simplified().
The existing check fails to detect the case where white space characters
other than the space character are replaced by space characters
without the length actually changing and returns the original string.
Task-number: QTBUG-44936
Change-Id: Ice6faa975f8b41f185c76f6d0d4ff81603e25eb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/tools/qstring/tst_qstring.cpp')
-rw-r--r-- | tests/auto/corelib/tools/qstring/tst_qstring.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/auto/corelib/tools/qstring/tst_qstring.cpp b/tests/auto/corelib/tools/qstring/tst_qstring.cpp index 8cd9610542..d2f7a6ee50 100644 --- a/tests/auto/corelib/tools/qstring/tst_qstring.cpp +++ b/tests/auto/corelib/tools/qstring/tst_qstring.cpp @@ -2033,6 +2033,8 @@ void tst_QString::simplified_data() QTest::newRow("chars apart posttab") << "a \tb" << "a b"; QTest::newRow("chars apart pretab") << "a\t b" << "a b"; QTest::newRow("many words") << " just some random\ttext here" << "just some random text here"; + QTest::newRow("newlines") << "a\nb\nc" << "a b c"; + QTest::newRow("newlines-trailing") << "a\nb\nc\n" << "a b c"; } void tst_QString::simplified() |