forked from qt-creator/qt-creator
C++ indenter: Respect user indent with stream operators.
Reviewed-by: Erik Verbruggen
This commit is contained in:
@@ -44,6 +44,7 @@ private Q_SLOTS:
|
||||
void whitesmithsStyle();
|
||||
void singleLineEnum();
|
||||
void functionReturnType();
|
||||
void streamOp();
|
||||
};
|
||||
|
||||
struct Line {
|
||||
@@ -786,6 +787,27 @@ void tst_CodeFormatter::functionReturnType()
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
void tst_CodeFormatter::streamOp()
|
||||
{
|
||||
QList<Line> data;
|
||||
data
|
||||
<< Line("void foo () {")
|
||||
<< Line(" qDebug() << foo")
|
||||
<< Line(" << bar << moose")
|
||||
<< Line(" << bar +")
|
||||
<< Line(" foo - blah(1)")
|
||||
<< Line(" << '?'")
|
||||
<< Line(" << \"\\n\";")
|
||||
<< Line(" qDebug() << foo")
|
||||
<< Line(" << bar << moose", 13)
|
||||
<< Line(" << bar +")
|
||||
<< Line(" foo - blah(1)")
|
||||
<< Line(" << '?'")
|
||||
<< Line(" << \"\\n\";")
|
||||
;
|
||||
checkIndent(data);
|
||||
}
|
||||
|
||||
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
||||
#include "tst_codeformatter.moc"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user