diff --git a/autotests/syntaxrepository_test.cpp b/autotests/syntaxrepository_test.cpp --- a/autotests/syntaxrepository_test.cpp +++ b/autotests/syntaxrepository_test.cpp @@ -223,6 +223,37 @@ QCOMPARE(definitionNames, expectedDefinitionNames); } + void testIncludedFormats() + { + QStringList definitionNames; + foreach (const auto &def, m_repo.definitions()) { + definitionNames.push_back(def.name()); + } + + foreach (const QString & name, definitionNames) { + Repository repo; + auto def = repo.definitionForName(name); + auto includedDefs = def.includedDefinitions(); + includedDefs.push_front(def); + + // collect all formats, shall be numbered from 1.. + QSet formatIds; + for (auto d : qAsConst(includedDefs)) { + const auto formats = d.formats(); + for (const auto format : formats) { + // no duplicates + QVERIFY(!formatIds.contains(format.id())); + formatIds.insert(format.id()); + } + } + + // ensure all ids are there from 1..size + for (int i = 1; i <= formatIds.size(); ++i) { + QVERIFY(formatIds.contains(i)); + } + } + } + void testReload() { auto def = m_repo.definitionForName(QLatin1String("QML")); diff --git a/data/syntax/alert_indent.xml b/data/syntax/alert_indent.xml deleted file mode 100644 --- a/data/syntax/alert_indent.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/data/syntax/coffee.xml b/data/syntax/coffee.xml --- a/data/syntax/coffee.xml +++ b/data/syntax/coffee.xml @@ -2,7 +2,7 @@ - + - + diff --git a/data/syntax/pig.xml b/data/syntax/pig.xml --- a/data/syntax/pig.xml +++ b/data/syntax/pig.xml @@ -1,7 +1,7 @@ - + load @@ -158,7 +158,7 @@ - + diff --git a/data/syntax/prolog.xml b/data/syntax/prolog.xml --- a/data/syntax/prolog.xml +++ b/data/syntax/prolog.xml @@ -105,7 +105,7 @@ ]> - + - + diff --git a/data/syntax/python.xml b/data/syntax/python.xml --- a/data/syntax/python.xml +++ b/data/syntax/python.xml @@ -14,7 +14,7 @@ - + import @@ -448,25 +448,25 @@ - + - + - + - +