forked from qt-creator/qt-creator
C++ indenter: Align to next token instead of end of current.
Task-number: QTCREATORBUG-3136 Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -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"
|
||||
|
||||
|
Reference in New Issue
Block a user