Skip to content

Commit

Permalink
Add test for #11 (#7140)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Dec 27, 2024
1 parent 32ab7db commit 1b807e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/testother.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5649,6 +5649,19 @@ class TestOther : public TestFixture {
" }\n"
"}\n");
ASSERT_EQUALS("", errout_str());

check("int main(int argc, char *argv[]) {\n" // #11
" switch (argc) {\n"
" case 0: {\n"
" return 1;\n"
" }\n"
" break;\n"
" }\n"
" return 0;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:6]: (style) Consecutive return, break, continue, goto or throw statements are unnecessary.\n"
"[test.cpp:1]: (style) Parameter 'argv' can be declared as const array\n",
errout_str());
}

void redundantContinue() {
Expand Down

0 comments on commit 1b807e1

Please sign in to comment.