C++ indenter: Align to next token instead of end of current.

Task-number: QTCREATORBUG-3136
Reviewed-by: Erik Verbruggen
This commit is contained in:
Christian Kamm
2010-11-19 18:02:14 +01:00
parent f1a403c778
commit 7a616d5896
2 changed files with 34 additions and 15 deletions

View File

@@ -56,6 +56,7 @@ private Q_SLOTS:
void cpp0xFor();
void gnuStyleSwitch();
void whitesmithsStyleSwitch();
void indentToNextToken();
};
struct Line {
@@ -1098,6 +1099,23 @@ void tst_CodeFormatter::whitesmithsStyleSwitch()
checkIndent(data, 2);
}
void tst_CodeFormatter::indentToNextToken()
{
QList<Line> data;
data << Line("void foo( int i,")
<< Line("~ int j) {")
<< Line(" a << foo + ")
<< Line(" ~ bar;")
<< Line(" if (a &&")
<< Line(" ~ b) {")
<< Line(" foo; }")
<< Line(" if ( a &&")
<< Line(" ~ b) {")
<< Line(" foo; }")
;
checkIndent(data);
}
QTEST_APPLESS_MAIN(tst_CodeFormatter)
#include "tst_codeformatter.moc"