summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qstring/tst_qstring.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-05 09:11:11 +0100
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-03-12 05:32:41 +0000
commit5930a2d314d158f67bf3bf2bd940d7b67731ebde (patch)
tree54ba4bb14fd542ba0ce3d239a71d23b511551424 /tests/auto/corelib/tools/qstring/tst_qstring.cpp
parent718f87046a8fc2c0fb625dfc8641db0352ae9d92 (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.cpp2
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()