chiark
/
gitweb
/
~mdw
/
disorder
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
915ea29
)
Further macros.c testing
author
Richard Kettlewell
<rjk@greenend.org.uk>
Sat, 3 May 2008 19:59:58 +0000
(20:59 +0100)
committer
Richard Kettlewell
<rjk@greenend.org.uk>
Sat, 3 May 2008 19:59:58 +0000
(20:59 +0100)
lib/t-macros.c
patch
|
blob
|
blame
|
history
diff --git
a/lib/t-macros.c
b/lib/t-macros.c
index 22308f9cbb0a5d66a6f8be44d4c1d7462cf5cae6..479d2fbac8ba1e8fb0d87e41398ff53b1db011d6 100644
(file)
--- 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{arg1}{arg2}@", NULL);
check_string(mx_dump(m), "@macro{arg1}{arg2}@");
- m = mx_parse("macro
7
", 1, "@macro{\narg1}{\narg2}@", NULL);
+ m = mx_parse("macro
8
", 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
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 macro
8
: */
+ * the \n at the end of line 1. Compare with macro
9
: */
- m = mx_parse("macro
8
", 1, "@macro\n{arg1}\n{arg2}@", NULL);
+ m = mx_parse("macro
9
", 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);
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}@}@");
}
}