Skip to content

Commit 3db9625

Browse files
committed
test.cpp: added test for #185 [skip ci]
1 parent 51e12d4 commit 3db9625

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,33 @@ static void define16() // #201
755755
"\"Blue\" , \"Green\" , \"Purple\" , \"Red\" , \"Yellow\" , \"Orange\" ,", preprocess(code));
756756
}
757757

758+
static void define17() // #185
759+
{
760+
const char code[] = "#define at(x, y) x##y\n"
761+
"#define b(...) \\\n"
762+
"aa(__VA_ARGS__, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , \\\n"
763+
", , , , , , , , 2)\n"
764+
"#define aa(c, d, a, b, e, f, g, h, ab, ac, i, ad, j, k, l, m, n, o, p, ae, q, \\\n"
765+
"r, s, t, u, v, w, x, y, z, af, ag, ah, ai, aj, ak, al, am, an, ao, \\\n"
766+
"ap) \\\n"
767+
"ap\n"
768+
"#define aq(...) ar(b(__VA_ARGS__), __VA_ARGS__) static_assert(true, \" \")\n"
769+
"#define ar(ap, ...) at(I_, ap)(__VA_ARGS__)\n"
770+
"#define I_2(as, a)\n"
771+
"aq(a, array);\n";
772+
ASSERT_EQUALS("\n"
773+
"\n"
774+
"\n"
775+
"\n"
776+
"\n"
777+
"\n"
778+
"\n"
779+
"\n"
780+
"\n"
781+
"\n"
782+
"\n"
783+
"static_assert ( true , \" \" ) ;", preprocess(code));
784+
}
758785

759786

760787
static void define_invalid_1()
@@ -3731,6 +3758,7 @@ int main(int argc, char **argv)
37313758
TEST_CASE(define14); // #296
37323759
TEST_CASE(define15); // #231
37333760
TEST_CASE(define16); // #201
3761+
TEST_CASE(define17); // #185
37343762
TEST_CASE(define_invalid_1);
37353763
TEST_CASE(define_invalid_2);
37363764
TEST_CASE(define_define_1);

0 commit comments

Comments
 (0)