Skip to content

Commit

Permalink
Add test for #374 (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github authored Oct 26, 2024
1 parent d9edfb0 commit 0ab783c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,13 @@ static void define_define_11a()
"#define TEST_MACRO CONCAT(A, B, C)\n"
"TEST_MACRO\n";
ASSERT_EQUALS("\n\n\n\n\n0x1", preprocess(code));

const char code2[] = "#define ADDER_S(a, b) a + b\n" // #374
"#define ADDER(x) ADDER_S(x)\n"
"#define ARGUMENTS 1, 2\n"
"#define RUN ADDER(ARGUMENTS)\n"
"void f() { RUN; }\n";
ASSERT_EQUALS("\n\n\n\nvoid f ( ) { 1 + 2 ; }", preprocess(code2));
}

static void define_define_12()
Expand Down

0 comments on commit 0ab783c

Please sign in to comment.