test/testtokenize.cpp: use tokenizeAndStringify() function.
Instead of self-written code. No functional change.
This commit is contained in:
parent
9fa8c0ee9c
commit
88d7c598e3
|
@ -351,17 +351,10 @@ private:
|
|||
" if (5==5);\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(" void f ( ) { { ; } }", ostr.str());
|
||||
ASSERT_EQUALS("void f ( )\n"
|
||||
"{\n"
|
||||
"{ ; }\n"
|
||||
"}", tokenizeAndStringify(code, true));
|
||||
}
|
||||
|
||||
void ifAddBraces1()
|
||||
|
|
Loading…
Reference in New Issue