forked from qt-creator/qt-creator
C++ indenter: Fix labels.
Reviewed-by: Roberto Raggi
This commit is contained in:
@@ -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"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user