MCPcopy Create free account
hub / github.com/KDE/kdevelop / testImplementOtherFile

Method testImplementOtherFile

plugins/clang/tests/test_codecompletion.cpp:1051–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1049}
1050
1051void TestCodeCompletion::testImplementOtherFile()
1052{
1053 TestFile header1(QStringLiteral("void foo();"), QStringLiteral("h"));
1054 QVERIFY(header1.parseAndWait());
1055 TestFile header2(QStringLiteral("void bar();"), QStringLiteral("h"));
1056 QVERIFY(header2.parseAndWait());
1057 TestFile impl(QString("#include \"%1\"\n"
1058 "#include \"%2\"\n"
1059 "void asdf();\n\n")
1060 .arg(header1.url().str(), header2.url().str()),
1061 QStringLiteral("cpp"), &header1);
1062
1063 CompletionItems expectedItems{{3,1}, {"asdf()", "foo()"}};
1064 QVERIFY(impl.parseAndWait(TopDUContext::AllDeclarationsContextsUsesAndAST));
1065 executeCompletionTest(impl.topContext(), expectedItems);
1066}
1067
1068void TestCodeCompletion::testImplementAfterEdit()
1069{

Callers

nothing calls this directly

Calls 6

executeCompletionTestFunction · 0.85
parseAndWaitMethod · 0.80
strMethod · 0.80
QStringClass · 0.50
urlMethod · 0.45
topContextMethod · 0.45

Tested by

no test coverage detected