CppTools: Fix indentation for concatenated strings

Change-Id: I801a56804e7873be75a9ebc085dc3f4a2d64ea35
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Orgad Shaneh
2014-03-26 18:54:04 +02:00
committed by Orgad Shaneh
parent 5416557a0b
commit aeb2cfbc4f
3 changed files with 35 additions and 1 deletions

View File

@@ -128,6 +128,7 @@ private Q_SLOTS:
void attributeInAccessSpecifier();
void braceReturn();
void staticVarDeclWithTypeDecl();
void strings();
};
struct Line {
@@ -2154,6 +2155,23 @@ void tst_CodeFormatter::staticVarDeclWithTypeDecl()
checkIndent(data);
}
void tst_CodeFormatter::strings()
{
QList<Line> data;
data << Line("char *a = \"foo\"")
<< Line(" \"bar\" \"why\"")
<< Line(" \"baz\";")
<< Line("void foo()")
<< Line("{")
<< Line(" func(1, 2, \"foo\"")
<< Line(" \"bar\"")
<< Line(" \"baz\", 4,")
<< Line(" ~ 5, 6);")
<< Line("}")
;
checkIndent(data);
}
QTEST_MAIN(tst_CodeFormatter)
#include "tst_codeformatter.moc"