Skip to content

Commit f294a7e

Browse files
committed
test
1 parent 6a4fedd commit f294a7e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

‎test/testtokenize.cpp‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,7 @@ class TestTokenizer : public TestFixture {
490490
TEST_CASE(checkConfiguration);
491491

492492
TEST_CASE(unknownMacroBeforeReturn);
493+
TEST_CASE(unknownMacroTooLargeInt);
493494

494495
TEST_CASE(cppKeywordInCSource);
495496

@@ -8853,6 +8854,15 @@ class TestTokenizer : public TestFixture {
88538854
ASSERT_THROW_INTERNAL(tokenizeAndStringify("int f() { X return 0; }\n"), UNKNOWN_MACRO);
88548855
}
88558856

8857+
void unknownMacroTooLargeInt() {
8858+
ASSERT_THROW_INTERNAL_EQUALS(tokenizeAndStringify("int x = STR(123456789012345678901234567890123456789);\n"),
8859+
UNKNOWN_MACRO,
8860+
"There is an unknown macro here somewhere. Configuration is required. If STR is a macro then please configure it.");
8861+
ASSERT_THROW_INTERNAL_EQUALS(tokenizeAndStringify("int x = 123456789012345678901234567890123456789;\n"),
8862+
SYNTAX,
8863+
"syntax error: integer literal too large");
8864+
}
8865+
88568866
void cppKeywordInCSource() {
88578867
ASSERT_NO_THROW(tokenizeAndStringify("int throw() {}\n", dinit(TokenizeOptions, $.cpp = false)));
88588868

0 commit comments

Comments
 (0)