Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
e7a6bae1
Commit
e7a6bae1
authored
Oct 20, 2010
by
Christian Kamm
Browse files
C++ indenter: Add autotest for C++0x 'for' statement.
Reviewed-by: trustme
parent
009d5cd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/auto/cplusplus/codeformatter/tst_codeformatter.cpp
View file @
e7a6bae1
...
...
@@ -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"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment