Changeset View
Changeset View
Standalone View
Standalone View
autotests/htmlhighlighter_test.cpp
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 48 | private Q_SLOTS: | |||
---|---|---|---|---|---|
62 | void testHighlight_data() | 62 | void testHighlight_data() | ||
63 | { | 63 | { | ||
64 | QTest::addColumn<QString>("inFile"); | 64 | QTest::addColumn<QString>("inFile"); | ||
65 | QTest::addColumn<QString>("outFile"); | 65 | QTest::addColumn<QString>("outFile"); | ||
66 | QTest::addColumn<QString>("refFile"); | 66 | QTest::addColumn<QString>("refFile"); | ||
67 | QTest::addColumn<QString>("syntax"); | 67 | QTest::addColumn<QString>("syntax"); | ||
68 | 68 | | |||
69 | const QDir dir(QStringLiteral(TESTSRCDIR "/input")); | 69 | const QDir dir(QStringLiteral(TESTSRCDIR "/input")); | ||
70 | foreach (const auto &fileName, dir.entryList(QDir::Files | QDir::NoSymLinks | QDir::Readable, QDir::Name)) { | 70 | for (const auto &fileName : dir.entryList(QDir::Files | QDir::NoSymLinks | QDir::Readable, QDir::Name)) { | ||
71 | const auto inFile = dir.absoluteFilePath(fileName); | 71 | const auto inFile = dir.absoluteFilePath(fileName); | ||
72 | if (inFile.endsWith(QLatin1String(".syntax"))) | 72 | if (inFile.endsWith(QLatin1String(".syntax"))) | ||
73 | continue; | 73 | continue; | ||
74 | 74 | | |||
75 | QString syntax; | 75 | QString syntax; | ||
76 | QFile syntaxOverride(inFile + QStringLiteral(".syntax")); | 76 | QFile syntaxOverride(inFile + QStringLiteral(".syntax")); | ||
77 | if (syntaxOverride.exists() && syntaxOverride.open(QFile::ReadOnly)) | 77 | if (syntaxOverride.exists() && syntaxOverride.open(QFile::ReadOnly)) | ||
78 | syntax = QString::fromUtf8(syntaxOverride.readAll()).trimmed(); | 78 | syntax = QString::fromUtf8(syntaxOverride.readAll()).trimmed(); | ||
▲ Show 20 Lines • Show All 43 Lines • Show Last 20 Lines |