Commit Diff


commit - 83e0f74d0776e6319be616d0e22926aef4a3042c
commit + 2871d3cec541fec15df6e963204e8235a439c2a3
blob - 2a90c70cd5e4af08090a85f82bcda63c20a83324
blob + bf2f3a05aa5733a7c0b1cc81ef7743d35633bd70
--- template/regress/Makefile
+++ template/regress/Makefile
@@ -4,7 +4,8 @@ REGRESS_TARGETS =	00-empty \
 			03-block \
 			04-flow \
 			05-loop \
-			06-escape
+			06-escape \
+			07-printf
 
 REGRESS_SETUP_ONCE =	setup-comp
 REGRESS_CLEANUP =	clean-comp
@@ -52,4 +53,8 @@ clean-comp:
 	${CC} 06-escape.o runbase.o tmpl.o -o t && ./t > got
 	diff -u ${.CURDIR}/06.expected got
 
+07-printf: 07-printf.o runbase.o tmpl.o
+	${CC} 07-printf.o runbase.o tmpl.o -o t && ./t > got
+	diff -u ${.CURDIR}/07.expected got
+
 .include <bsd.regress.mk>
blob - /dev/null
blob + b650ecf17c6935f219a6d2b7a016aa61f44c394d (mode 644)
--- /dev/null
+++ template/regress/07-printf.tmpl
@@ -0,0 +1,8 @@
+{!
+#include <stdio.h>
+#include <stdlib.h>
+!}
+
+{{ define base(struct template *tp, const char *title) }}
+{{ printf "%.2s:\t%d\n", title, 42 }}
+{{ end }}
blob - /dev/null
blob + 681daf3915b708a380ddc75467b47beceff9b367 (mode 644)
--- /dev/null
+++ template/regress/07.expected
@@ -0,0 +1,4 @@
+ *:	42
+
+&lt;h:	42
+