X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/blobdiff_plain/915ea29abfcae395a682284739a1032790c4da28..774eb34c4aae8b61859abffa823e5d5dbb59954f:/lib/t-macros.c diff --git a/lib/t-macros.c b/lib/t-macros.c index 22308f9..479d2fb 100644 --- a/lib/t-macros.c +++ b/lib/t-macros.c @@ -143,17 +143,25 @@ static void test_macros(void) { m = mx_parse("macro7", 1, "@macro{arg1}{arg2}@", NULL); check_string(mx_dump(m), "@macro{arg1}{arg2}@"); - m = mx_parse("macro7", 1, "@macro{\narg1}{\narg2}@", NULL); + m = mx_parse("macro8", 1, "@macro{\narg1}{\narg2}@", NULL); check_string(mx_dump(m), "@macro{\narg1}{\narg2}@"); check_integer(m->args[0]->line, 1); check_integer(m->args[1]->line, 2); /* ...yes, lines 1 and 2: the first character of the first arg is - * the \n at the end of line 1. Compare with macro8: */ + * the \n at the end of line 1. Compare with macro9: */ - m = mx_parse("macro8", 1, "@macro\n{arg1}\n{arg2}@", NULL); + m = mx_parse("macro9", 1, "@macro\n{arg1}\n{arg2}@", NULL); check_string(mx_dump(m), "@macro{arg1}{arg2}@"); check_integer(m->args[0]->line, 2); check_integer(m->args[1]->line, 3); + + /* Arguments that themselves contain expansions */ + m = mx_parse("macro10", 1, "@macro{@macro2{arg1}{arg2}@}@", NULL); + check_string(mx_dump(m), "@macro{@macro2{arg1}{arg2}@}@"); + + /* ...and with omitted trailing @ */ + m = mx_parse("macro11", 1, "@macro{@macro2{arg1}{arg2}}", NULL); + check_string(mx_dump(m), "@macro{@macro2{arg1}{arg2}@}@"); }