- char _cleanup_free_ *t = \
- unit_full_printf(unit, pattern); \
- printf("result: %s\n", t); \
- assert(streq(t, expected)); \
+ char *e; \
+ _cleanup_free_ char *t; \
+ assert_se(unit_full_printf(unit, pattern, &t) >= 0); \
+ printf("result: %s\nexpect: %s\n", t, expected); \
+ if ((e = endswith(expected, "*"))) \
+ assert(strncmp(t, e, e-expected)); \
+ else \
+ assert(streq(t, expected)); \