diff options
Diffstat (limited to 'tests/auto/qml/reformatter/tst_reformatter.cpp')
-rw-r--r-- | tests/auto/qml/reformatter/tst_reformatter.cpp | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/tests/auto/qml/reformatter/tst_reformatter.cpp b/tests/auto/qml/reformatter/tst_reformatter.cpp index 42d98e02bed..68b192fa600 100644 --- a/tests/auto/qml/reformatter/tst_reformatter.cpp +++ b/tests/auto/qml/reformatter/tst_reformatter.cpp @@ -68,25 +68,15 @@ void tst_Reformatter::test() QString rewritten = reformat(doc); - QStringList sourceLines = source.split(QLatin1Char('\n')); - QStringList newLines = rewritten.split(QLatin1Char('\n')); + QStringList sourceLines = source.split(QLatin1Char('\n'), Qt::SkipEmptyParts); + QStringList newLines = rewritten.split(QLatin1Char('\n'), Qt::SkipEmptyParts); // compare line by line int commonLines = qMin(newLines.size(), sourceLines.size()); - bool insideMultiLineComment = false; for (int i = 0; i < commonLines; ++i) { // names intentional to make 'Actual (sourceLine): ...\nExpected (newLinee): ...' line up const QString &sourceLine = sourceLines.at(i); const QString &newLinee = newLines.at(i); - if (!insideMultiLineComment && sourceLine.trimmed().startsWith("/*")) { - insideMultiLineComment = true; - sourceLines.insert(i, "\n"); - continue; - } - if (sourceLine.trimmed().endsWith("*/")) - insideMultiLineComment = false; - if (sourceLine.trimmed().isEmpty() && newLinee.trimmed().isEmpty()) - continue; bool fail = !QCOMPARE_NOEXIT(newLinee, sourceLine); if (fail) { qDebug() << "in line" << (i + 1); |