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

Method varTypeAssistant

plugins/astyle/tests/test_astyle.cpp:155–176  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155void TestAstyle::varTypeAssistant()
156{
157 // think this:
158 // asdf = 1;
159 // and you execute the assistant to get:
160 // int asdf = 1;
161
162 // test1: already indented
163 QString formattedSource = m_formatter->formatSource(
164 QStringLiteral("int "), QStringLiteral("int main() {\n "), QStringLiteral("asdf = 1;\n}\n")
165 );
166 qDebug() << "formatted source:" << formattedSource;
167 QCOMPARE(formattedSource, QString("int "));
168
169 // test2: not yet indented
170 formattedSource = m_formatter->formatSource(
171 QStringLiteral("int "), QStringLiteral("int main() {\n"), QStringLiteral("asdf = 1;\n}\n")
172 );
173 qDebug() << "formatted source:" << formattedSource;
174 QCOMPARE(formattedSource, QString(" int "));
175
176}
177
178void TestAstyle::testMultipleFormatters()
179{

Callers

nothing calls this directly

Calls 2

formatSourceMethod · 0.80
QStringClass · 0.50

Tested by

no test coverage detected