Test simplification of "delete a, b, c"

This commit is contained in:
Dmitry-Me 2015-03-27 17:49:35 +03:00
parent b637e70d63
commit 712b101862
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"