forked from qt-creator/qt-creator
C++ indenter: Fix indent of block statements in substatement blocks.
Task-number: QTCREATORBUG-1919
This commit is contained in:
@@ -45,6 +45,7 @@ private Q_SLOTS:
|
||||
void singleLineEnum();
|
||||
void functionReturnType();
|
||||
void streamOp();
|
||||
void blockStmtInIf();
|
||||
};
|
||||
|
||||
struct Line {
|
||||
@@ -817,6 +818,23 @@ void tst_CodeFormatter::streamOp()
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::blockStmtInIf()
|
||||
{
|
||||
QList<Line> data;
|
||||
data
|
||||
<< Line("void foo () {")
|
||||
<< Line(" if (a) {")
|
||||
<< Line(" {")
|
||||
<< Line(" foo;")
|
||||
<< Line(" }")
|
||||
<< Line(" } else {")
|
||||
<< Line(" {")
|
||||
<< Line(" foo;")
|
||||
<< Line(" }")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
||||
#include "tst_codeformatter.moc"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user