| 45 | } |
| 46 | |
| 47 | void 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 | |
| 66 | void TestDeclarations::testFunction() |
| 67 | { |