Skip to content

Commit 9ef5900

Browse files
committed
test.cpp: added test for #231
1 parent 5cef3c1 commit 9ef5900

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
@@ -703,6 +703,23 @@ static void define14() // #296
703703
"printf ( \"bar(3)\" \"\\n\" ) ;", preprocess(code));
704704
}
705705

706+
static void define15() // #231
707+
{
708+
const char code[] = "#define CAT(a, b) CAT2(a, b)\n"
709+
"#define CAT2(a, b) a ## b\n"
710+
"#define FOO x\n"
711+
"#define BAR() CAT(F, OO)\n"
712+
"#define BAZ CAT(B, AR)()\n"
713+
"BAZ\n";
714+
ASSERT_EQUALS("\n"
715+
"\n"
716+
"\n"
717+
"\n"
718+
"\n"
719+
"x", preprocess(code));
720+
}
721+
722+
706723

707724

708725
static void define_invalid_1()
@@ -3668,6 +3685,7 @@ int main(int argc, char **argv)
36683685
TEST_CASE(define12);
36693686
TEST_CASE(define13);
36703687
TEST_CASE(define14); // #296
3688+
TEST_CASE(define15); // #231
36713689
TEST_CASE(define_invalid_1);
36723690
TEST_CASE(define_invalid_2);
36733691
TEST_CASE(define_define_1);

0 commit comments

Comments
 (0)