forked from qt-creator/qt-creator
C++ indenter: Add autotest for C++0x 'for' statement.
Reviewed-by: trustme
This commit is contained in:
@@ -52,6 +52,7 @@ private Q_SLOTS:
|
|||||||
void templateSingleline();
|
void templateSingleline();
|
||||||
void macrosNoSemicolon2();
|
void macrosNoSemicolon2();
|
||||||
void renamedNamespace();
|
void renamedNamespace();
|
||||||
|
void cpp0xFor();
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Line {
|
struct Line {
|
||||||
@@ -1000,6 +1001,24 @@ void tst_CodeFormatter::renamedNamespace()
|
|||||||
checkIndent(data);
|
checkIndent(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_CodeFormatter::cpp0xFor()
|
||||||
|
{
|
||||||
|
QList<Line> data;
|
||||||
|
data
|
||||||
|
<< Line("void foo()")
|
||||||
|
<< Line("{")
|
||||||
|
<< Line(" vector<int> x = setup();")
|
||||||
|
<< Line(" for(int p : x) {")
|
||||||
|
<< Line(" bar(p);")
|
||||||
|
<< Line(" }")
|
||||||
|
<< Line("}")
|
||||||
|
<< Line("void car()")
|
||||||
|
<< Line("{")
|
||||||
|
<< Line(" int i;")
|
||||||
|
;
|
||||||
|
checkIndent(data);
|
||||||
|
}
|
||||||
|
|
||||||
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
QTEST_APPLESS_MAIN(tst_CodeFormatter)
|
||||||
#include "tst_codeformatter.moc"
|
#include "tst_codeformatter.moc"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user