testtokenize: updated 'TestTokenize::simplify_function_parameters'
This commit is contained in:
parent
37ddf6a0a8
commit
8e7ff3bace
|
@ -749,6 +749,28 @@ private:
|
|||
ostr << " " << tok->str();
|
||||
ASSERT_EQUALS(std::string(" void f ( int x, char y ) { }"), ostr.str());
|
||||
}
|
||||
|
||||
{
|
||||
// This is not a function but the pattern is similar..
|
||||
const char code[] = "void foo()\n"
|
||||
"{\n"
|
||||
" if (x)\n"
|
||||
" int x;\n"
|
||||
" { }\n"
|
||||
"}\n";
|
||||
|
||||
// tokenize..
|
||||
Tokenizer tokenizer;
|
||||
std::istringstream istr(code);
|
||||
tokenizer.tokenize(istr, "test.cpp");
|
||||
|
||||
tokenizer.simplifyTokenList();
|
||||
|
||||
std::ostringstream ostr;
|
||||
for (const Token *tok = tokenizer.tokens(); tok; tok = tok->next())
|
||||
ostr << " " << tok->str();
|
||||
ASSERT_EQUALS(std::string(" void foo ( ) { if ( x ) int x ; { } }"), ostr.str());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue