Commit e7a6bae1 authored by Christian Kamm's avatar Christian Kamm
Browse files

C++ indenter: Add autotest for C++0x 'for' statement.

Reviewed-by: trustme
parent 009d5cd0
......@@ -52,6 +52,7 @@ private Q_SLOTS:
void templateSingleline();
void macrosNoSemicolon2();
void renamedNamespace();
void cpp0xFor();
};
struct Line {
......@@ -1000,6 +1001,24 @@ void tst_CodeFormatter::renamedNamespace()
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)
#include "tst_codeformatter.moc"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment