Added test case multi_character_character

This commit is contained in:
Reijo Tomperi 2009-01-21 19:12:28 +00:00
parent 5fa9fce8d4
commit 9f63e2227b
1 changed files with 21 additions and 0 deletions

View File

@ -82,6 +82,7 @@ private:
TEST_CASE(preprocessor_doublesharp);
TEST_CASE(preprocessor_include_in_str);
// TODO TEST_CASE(fmt);
TEST_CASE(multi_character_character);
}
@ -581,6 +582,26 @@ private:
ASSERT_EQUALS("\nprintf(\"[0x%lx-0x%lx)\", pstart, pend);", actual);
}
void multi_character_character()
{
const char filedata[] = "#define FOO 'ABCD'\n"
"int main()\n"
"{\n"
"if( FOO == 0 );\n"
"return 0;\n"
"}\n";
// Preprocess => actual result..
std::istringstream istr(filedata);
std::map<std::string, std::string> actual;
Preprocessor preprocessor;
preprocessor.preprocess(istr, actual);
// Compare results..
ASSERT_EQUALS(1, actual.size());
ASSERT_EQUALS("#define FOO 'ABCD'\nint main()\n{\nif( 'ABCD' == 0 );\nreturn 0;\n}\n", actual[""]);
}
};
REGISTER_TEST(TestPreprocessor)