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

Method testBasicProblems

plugins/clang/tests/test_problems.cpp:103–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void TestProblems::testBasicProblems()
104{
105 // expected:
106 // <stdin>:1:13: error: expected ';' after class
107 // class Foo {}
108 // ^
109 // ;
110 const QByteArray code = "class Foo {}";
111 auto problems = parse(code);
112 QCOMPARE(problems.size(), 1);
113 QCOMPARE(problems[0]->diagnostics().size(), 0);
114 auto range = problems[0]->rangeInCurrentRevision();
115 QCOMPARE(range.start(), KTextEditor::Cursor(0, 12));
116 QCOMPARE(range.end(), KTextEditor::Cursor(0, 12));
117}
118
119void TestProblems::testBasicRangeSupport()
120{

Callers

nothing calls this directly

Calls 7

parseFunction · 0.70
CursorClass · 0.50
sizeMethod · 0.45
diagnosticsMethod · 0.45
startMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected