Changeset View
Changeset View
Standalone View
Standalone View
plugins/clang/tests/test_codecompletion.cpp
Show First 20 Lines • Show All 1381 Lines • ▼ Show 20 Line(s) | 1379 | QTest::newRow("bug377397") | |||
---|---|---|---|---|---|
1382 | << "Foo<T>::bar()" | 1382 | << "Foo<T>::bar()" | ||
1383 | << "template<typename T> class Foo {\nvoid bar();\n};\ntemplate<typename T> void Foo<T>::bar()\n{\n}\n"; | 1383 | << "template<typename T> class Foo {\nvoid bar();\n};\ntemplate<typename T> void Foo<T>::bar()\n{\n}\n"; | ||
1384 | 1384 | | |||
1385 | QTest::newRow("template-template-parameter") | 1385 | QTest::newRow("template-template-parameter") | ||
1386 | << "template <template<class, int> class X, typename B>\nclass Test {\npublic:\nvoid bar(B a);\n};\n" | 1386 | << "template <template<class, int> class X, typename B>\nclass Test {\npublic:\nvoid bar(B a);\n};\n" | ||
1387 | << CompletionItems({5, 0}, {"Test", "Test<X, B>::bar(B a)"}) | 1387 | << CompletionItems({5, 0}, {"Test", "Test<X, B>::bar(B a)"}) | ||
1388 | << "Test<X, B>::bar(B a)" | 1388 | << "Test<X, B>::bar(B a)" | ||
1389 | << "template <template<class, int> class X, typename B>\nclass Test {\npublic:\nvoid bar(B a);\n};\ntemplate<template<typename, int> class X, typename B> void Test<X, B>::bar(B a)\n{\n}\n"; | 1389 | << "template <template<class, int> class X, typename B>\nclass Test {\npublic:\nvoid bar(B a);\n};\ntemplate<template<typename, int> class X, typename B> void Test<X, B>::bar(B a)\n{\n}\n"; | ||
1390 | | ||||
1391 | QTest::newRow("replace-leading-return-type") | ||||
1392 | << "void foo(int x);\nvoid " | ||||
1393 | << CompletionItems({1, 5}, {"foo(int x)"}) | ||||
1394 | << "foo(int x)" | ||||
1395 | << "void foo(int x);\nvoid foo(int x)\n{\n}\n"; | ||||
1396 | | ||||
1397 | QTest::newRow("replace-leading-function-name") | ||||
1398 | << "void foo(int x);\nfoo" | ||||
1399 | << CompletionItems({1, 3}, {"foo(int x)"}) | ||||
1400 | << "foo(int x)" | ||||
1401 | << "void foo(int x);\nvoid foo(int x)\n{\n}\n"; | ||||
1402 | | ||||
1403 | QTest::newRow("replace-leading-with-class-method") | ||||
mwolff: ah yes, then please keep the old version and duplicate this one with a different row title - I… | |||||
1404 | << "class Foo { void bar(int x); };\nvoid " | ||||
1405 | << CompletionItems({1, 5}, {"Foo", "Foo::bar(int x)"}) | ||||
1406 | << "Foo::bar(int x)" | ||||
1407 | << "class Foo { void bar(int x); };\nvoid Foo::bar(int x)\n{\n}\n"; | ||||
1390 | } | 1408 | } | ||
1391 | 1409 | | |||
1392 | void TestCodeCompletion::testIgnoreGccBuiltins() | 1410 | void TestCodeCompletion::testIgnoreGccBuiltins() | ||
1393 | { | 1411 | { | ||
1394 | // TODO: make it easier to change the compiler provider for testing purposes | 1412 | // TODO: make it easier to change the compiler provider for testing purposes | ||
1395 | QTemporaryDir dir; | 1413 | QTemporaryDir dir; | ||
1396 | auto project = new TestProject(Path(dir.path()), this); | 1414 | auto project = new TestProject(Path(dir.path()), this); | ||
1397 | auto definesAndIncludesConfig = project->projectConfiguration()->group("CustomDefinesAndIncludes"); | 1415 | auto definesAndIncludesConfig = project->projectConfiguration()->group("CustomDefinesAndIncludes"); | ||
Show All 13 Lines |
ah yes, then please keep the old version and duplicate this one with a different row title - I was looking for a row that had "whitespace mismatch" or similar in its title