Changeset View
Changeset View
Standalone View
Standalone View
autotests/syntaxrepository_test.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Line(s) | 140 | { | |||
---|---|---|---|---|---|
143 | QVERIFY(!def.indentationBasedFoldingEnabled()); | 143 | QVERIFY(!def.indentationBasedFoldingEnabled()); | ||
144 | 144 | | |||
145 | def = m_repo.definitionForName(QLatin1String("Python")); | 145 | def = m_repo.definitionForName(QLatin1String("Python")); | ||
146 | QVERIFY(def.isValid()); | 146 | QVERIFY(def.isValid()); | ||
147 | QVERIFY(def.indentationBasedFoldingEnabled()); | 147 | QVERIFY(def.indentationBasedFoldingEnabled()); | ||
148 | QCOMPARE(def.foldingIgnoreList(), QStringList() << QLatin1String("(?:\\s+|\\s*#.*)")); | 148 | QCOMPARE(def.foldingIgnoreList(), QStringList() << QLatin1String("(?:\\s+|\\s*#.*)")); | ||
149 | } | 149 | } | ||
150 | 150 | | |||
151 | void testIncludedDefinitions() | ||||
152 | { | ||||
153 | auto def = m_repo.definitionForName(QLatin1String("C++")); | ||||
154 | QVERIFY(def.isValid()); | ||||
155 | auto defs = def.includedDefinitions(); | ||||
156 | | ||||
157 | const QStringList expectedDefinitionNames = { | ||||
158 | QStringLiteral("C++"), | ||||
159 | QStringLiteral("ISO C++"), | ||||
160 | QStringLiteral("GCCExtensions"), | ||||
161 | QStringLiteral("Doxygen"), | ||||
162 | QStringLiteral("Alerts"), | ||||
163 | QStringLiteral("Modelines") | ||||
164 | }; | ||||
165 | QStringList definitionNames; | ||||
166 | for (auto d : defs) { | ||||
167 | definitionNames.push_back(d.name()); | ||||
168 | } | ||||
169 | QCOMPARE(definitionNames, expectedDefinitionNames); | ||||
170 | } | ||||
171 | | ||||
151 | void testReload() | 172 | void testReload() | ||
152 | { | 173 | { | ||
153 | auto def = m_repo.definitionForName(QLatin1String("QML")); | 174 | auto def = m_repo.definitionForName(QLatin1String("QML")); | ||
154 | QVERIFY(!m_repo.definitions().isEmpty()); | 175 | QVERIFY(!m_repo.definitions().isEmpty()); | ||
155 | QVERIFY(def.isValid()); | 176 | QVERIFY(def.isValid()); | ||
156 | 177 | | |||
157 | NullHighlighter hl; | 178 | NullHighlighter hl; | ||
158 | hl.setDefinition(def); | 179 | hl.setDefinition(def); | ||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |