Skip to content

Commit 4c636dc

Browse files
committed
test.cpp: added test for #231
1 parent 50d1aad commit 4c636dc

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

test.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,23 @@ static void define14() // #296
731731
"printf ( \"bar(3)\" \"\\n\" ) ;", preprocess(code));
732732
}
733733

734+
static void define15() // #231
735+
{
736+
const char code[] = "#define CAT(a, b) CAT2(a, b)\n"
737+
"#define CAT2(a, b) a ## b\n"
738+
"#define FOO x\n"
739+
"#define BAR() CAT(F, OO)\n"
740+
"#define BAZ CAT(B, AR)()\n"
741+
"BAZ\n";
742+
ASSERT_EQUALS("\n"
743+
"\n"
744+
"\n"
745+
"\n"
746+
"\n"
747+
"x", preprocess(code));
748+
}
749+
750+
734751

735752

736753
static void define_invalid_1()
@@ -3698,6 +3715,7 @@ static void runTests(int argc, char **argv, Input input)
36983715
TEST_CASE(define12);
36993716
TEST_CASE(define13);
37003717
TEST_CASE(define14); // #296
3718+
TEST_CASE(define15); // #231
37013719
TEST_CASE(define_invalid_1);
37023720
TEST_CASE(define_invalid_2);
37033721
TEST_CASE(define_define_1);

0 commit comments

Comments
 (0)