From 5930a2d314d158f67bf3bf2bd940d7b67731ebde Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 5 Mar 2015 09:11:11 +0100 Subject: 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 --- tests/auto/corelib/tools/qstring/tst_qstring.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tests') 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() -- cgit v1.2.3