5 #include <ccan/cppmagic/cppmagic.h>
6 #include <ccan/tap/tap.h>
8 static inline void check1(const char *orig, const char *expand,
11 ok(strcmp(expand, match) == 0,
12 "%s => %s : %s", orig, expand, match);
15 #define CHECK1(orig, match) \
16 check1(#orig, CPPMAGIC_STRINGIFY(orig), match)
22 CHECK1(CPPMAGIC_NOTHING(), "");
23 CHECK1(CPPMAGIC_GLUE2(a, b), "ab");
25 CHECK1(CPPMAGIC_1ST(a), "a");
26 CHECK1(CPPMAGIC_1ST(a, b), "a");
27 CHECK1(CPPMAGIC_1ST(a, b, c), "a");
29 CHECK1(CPPMAGIC_2ND(a, b), "b");
30 CHECK1(CPPMAGIC_2ND(a, b, c), "b");
32 /* This exits depending on whether all tests passed */