Merge pull request #581 from Dmitry-Me/moreTestsForDeleteWithComma

Test simplification of "delete a, b, c"
This commit is contained in:
amai2012 2015-03-29 20:40:01 +02:00
commit 022b40b36f
1 changed files with 21 additions and 0 deletions

View File

@ -1799,6 +1799,16 @@ private:
ASSERT_EQUALS("void foo ( ) { char * a ; char * b ; delete a ; b ; }", tok(code));
}
{
const char code[] = "void foo()\n"
"{\n"
" char *a, *b, *c;\n"
" delete a, b, c;\n"
"}\n";
// delete a; b; c; would be better but this will do too
ASSERT_EQUALS("void foo ( ) { char * a ; char * b ; char * c ; delete a ; b , c ; }", tok(code));
}
{
const char code[] = "void foo()\n"
"{\n"
@ -1809,6 +1819,17 @@ private:
ASSERT_EQUALS("void foo ( ) { char * a ; char * b ; if ( x ) { delete a ; b ; } }", tok(code));
}
{
const char code[] = "void foo()\n"
"{\n"
" char *a, *b, *c;\n"
" if (x) \n"
" delete a, b, c;\n"
"}\n";
// delete a; b; c; would be better but this will do too
ASSERT_EQUALS("void foo ( ) { char * a ; char * b ; char * c ; if ( x ) { delete a ; b , c ; } }", tok(code));
}
{
const char code[] = "void foo()\n"
"{\n"