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

Method testJSProblems

plugins/qmljs/duchain/tests/test_qmljsdeclarations.cpp:47–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47void TestDeclarations::testJSProblems()
48{
49 const IndexedString file(QUrl(QStringLiteral("file:///internal/jsproblems.js")));
50 ParseSession session(file,
51 "function f(a) {}\n"
52 "f(2);\n"
53 "f(true);\n",
54 0);
55
56 QVERIFY(session.ast());
57 DeclarationBuilder builder(&session);
58
59 builder.build(file, session.ast());
60 auto problems = session.problems();
61
62 QCOMPARE(problems.count(), 1);
63 QCOMPARE((KTextEditor::Range)problems.at(0)->finalLocation(), KTextEditor::Range(2, 2, 2, 6));
64}
65
66void TestDeclarations::testFunction()
67{

Callers

nothing calls this directly

Calls 8

QUrlClass · 0.50
RangeFunction · 0.50
astMethod · 0.45
buildMethod · 0.45
problemsMethod · 0.45
countMethod · 0.45
finalLocationMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected