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

Method testForeach

plugins/astyle/tests/test_astyle.cpp:309–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309void TestAstyle::testForeach()
310{
311 AStyleFormatter formatter;
312 QVERIFY(formatter.predefinedStyle("KDELibs"));
313
314 const QString initial(QStringLiteral("int a(){QList<int> v;\n foreach(int i,v){\nreturn i;}}\n"));
315 const QString expected(QStringLiteral("int a()\n{\n QList<int> v;\n foreach (int i, v) {\n return i;\n }\n}\n"));
316 const QString formatted = formatter.formatSource(initial);
317 QCOMPARE(formatted, expected);
318}
319
320void TestAstyle::testPointerAlignment()
321{

Callers

nothing calls this directly

Calls 2

formatSourceMethod · 0.80
predefinedStyleMethod · 0.45

Tested by

no test coverage detected