C++ indenter: Fix labels.

Reviewed-by: Roberto Raggi
This commit is contained in:
Christian Kamm
2010-12-01 10:19:53 +01:00
parent bb654838cf
commit c5c4bacda9
3 changed files with 37 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ private Q_SLOTS:
void gnuStyleSwitch();
void whitesmithsStyleSwitch();
void indentToNextToken();
void labels();
};
struct Line {
@@ -1116,6 +1117,21 @@ void tst_CodeFormatter::indentToNextToken()
checkIndent(data);
}
void tst_CodeFormatter::labels()
{
QList<Line> data;
data << Line("void foo() {")
<< Line("lab:")
<< Line(" int abc;")
<< Line("def:")
<< Line(" if (a)")
<< Line("boo:")
<< Line(" foo;")
<< Line(" int j;")
;
checkIndent(data);
}
QTEST_APPLESS_MAIN(tst_CodeFormatter)
#include "tst_codeformatter.moc"