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

Method testBasicRangeSupport

plugins/clang/tests/test_problems.cpp:119–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117}
118
119void TestProblems::testBasicRangeSupport()
120{
121 // expected:
122 // <stdin>:1:17: warning: expression result unused [-Wunused-value]
123 // int main() { (1 + 1); }
124 // ~ ^ ~
125 const QByteArray code = "int main() { (1 + 1); }";
126 auto problems = parse(code);
127 QCOMPARE(problems.size(), 1);
128 QCOMPARE(problems[0]->diagnostics().size(), 0);
129 auto range = problems[0]->rangeInCurrentRevision();
130 QCOMPARE(range.start(), KTextEditor::Cursor(0, 14));
131 QCOMPARE(range.end(), KTextEditor::Cursor(0, 19));
132}
133
134void TestProblems::testChildDiagnostics()
135{

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