Changeset View
Changeset View
Standalone View
Standalone View
plugins/clang/tests/test_codecompletion.cpp
Show First 20 Lines • Show All 1348 Lines • ▼ Show 20 Line(s) | 1346 | QTest::newRow("add-parens") | |||
---|---|---|---|---|---|
1349 | << "foo" | 1349 | << "foo" | ||
1350 | << "int foo();\nint main() {\nfoo()\n}"; | 1350 | << "int foo();\nint main() {\nfoo()\n}"; | ||
1351 | 1351 | | |||
1352 | QTest::newRow("keep-parens") | 1352 | QTest::newRow("keep-parens") | ||
1353 | << "int foo();\nint main() {\nfoo();\n}" | 1353 | << "int foo();\nint main() {\nfoo();\n}" | ||
1354 | << CompletionItems({2, 0}, {"foo", "main"}) | 1354 | << CompletionItems({2, 0}, {"foo", "main"}) | ||
1355 | << "main" | 1355 | << "main" | ||
1356 | << "int foo();\nint main() {\nmain();\n}"; | 1356 | << "int foo();\nint main() {\nmain();\n}"; | ||
1357 | | ||||
1358 | QTest::newRow("bug375635") | ||||
1359 | << "enum class Color {\nBlue, Green, Red, Yellow\n};\nvoid foo() {\nColor x;\nswitch (x) {\ncase : break;}\n}" | ||||
1360 | << CompletionItems({6, 5}, {"Blue", "Green", "Red", "Yellow"}) | ||||
1361 | << "Yellow" | ||||
1362 | << "enum class Color {\nBlue, Green, Red, Yellow\n};\nvoid foo() {\nColor x;\nswitch (x) {\ncase Color::Yellow: break;}\n}"; | ||||
1357 | } | 1363 | } | ||
1358 | 1364 | | |||
1359 | void TestCodeCompletion::testIgnoreGccBuiltins() | 1365 | void TestCodeCompletion::testIgnoreGccBuiltins() | ||
1360 | { | 1366 | { | ||
1361 | // TODO: make it easier to change the compiler provider for testing purposes | 1367 | // TODO: make it easier to change the compiler provider for testing purposes | ||
1362 | QTemporaryDir dir; | 1368 | QTemporaryDir dir; | ||
1363 | auto project = new TestProject(Path(dir.path()), this); | 1369 | auto project = new TestProject(Path(dir.path()), this); | ||
1364 | auto definesAndIncludesConfig = project->projectConfiguration()->group("CustomDefinesAndIncludes"); | 1370 | auto definesAndIncludesConfig = project->projectConfiguration()->group("CustomDefinesAndIncludes"); | ||
Show All 13 Lines |