Do not use QDir::separator() in QML reformatter test

That created a mix of / and \\ while building the path. Qt promises to
build paths that conforms to underlying OS if we always use /.

Amends  ffcbbecf27

Change-Id: Iebcb739cc02f0a2d6dd8953943ecfa9cf8fc9aea
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Semih Yavuz
2023-11-09 13:44:32 +01:00
parent e3c1179abb
commit 5b1aa26e47

View File

@@ -50,8 +50,8 @@ void tst_Reformatter::test_data()
// makes a change inline, for example whitespace removal. We omit
// those files in this test.
QSet<QString> excludedFiles;
excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml";
excludedFiles << QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml";
excludedFiles << QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.qml";
excludedFiles << QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.formatted.qml";
QDirIterator it(TESTSRCDIR, QStringList() << QLatin1String("*.qml") << QLatin1String("*.js"), QDir::Files);
while (it.hasNext()) {
@@ -103,8 +103,8 @@ void tst_Reformatter::reformatter_data()
QTest::addColumn<QString>("formattedFilePath");
QTest::newRow("typeAnnotations")
<< QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.qml"
<< QString::fromLatin1(TESTSRCDIR) + QDir::separator() + "typeAnnotations.formatted.qml";
<< QString::fromLatin1(TESTSRCDIR) + "/typeAnnotations.qml"
<< QString::fromLatin1(TESTSRCDIR) +"/typeAnnotations.formatted.qml";
}
void tst_Reformatter::reformatter()