Skip to content

Commit 090a5b8

Browse files
committed
test
1 parent 4ffe325 commit 090a5b8

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
@@ -491,6 +491,7 @@ class TestTokenizer : public TestFixture {
491491

492492
TEST_CASE(unknownMacroBeforeReturn);
493493
TEST_CASE(unknownMacroBracedArgument);
494+
TEST_CASE(unknownMacroTooLargeInt);
494495

495496
TEST_CASE(cppKeywordInCSource);
496497

@@ -8860,6 +8861,15 @@ class TestTokenizer : public TestFixture {
88608861
"There is an unknown macro here somewhere. Configuration is required. If F is a macro then please configure it.");
88618862
}
88628863

8864+
void unknownMacroTooLargeInt() {
8865+
ASSERT_THROW_INTERNAL_EQUALS(tokenizeAndStringify("int x = STR(123456789012345678901234567890123456789);\n"),
8866+
UNKNOWN_MACRO,
8867+
"There is an unknown macro here somewhere. Configuration is required. If STR is a macro then please configure it.");
8868+
ASSERT_THROW_INTERNAL_EQUALS(tokenizeAndStringify("int x = 123456789012345678901234567890123456789;\n"),
8869+
SYNTAX,
8870+
"syntax error: integer literal too large");
8871+
}
8872+
88638873
void cppKeywordInCSource() {
88648874
ASSERT_NO_THROW(tokenizeAndStringify("int throw() {}\n", dinit(TokenizeOptions, $.cpp = false)));
88658875

0 commit comments

Comments
 (0)