aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Linskey2026-06-07 03:58:03 -0400
committerBenjamin Linskey2026-06-07 03:58:03 -0400
commit18ba901d929fc4496453d8ff8f1f652d156ef2b9 (patch)
treeaf08a8f49065293f4290b0ab31900f9d3794ad45
parenta4ca4afc3ca9181e0c2acc283073549eb7627dea (diff)
downloadtpl-18ba901d929fc4496453d8ff8f1f652d156ef2b9.tar.gz

Add test script

-rwxr-xr-xtest.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/test.sh b/test.sh
new file mode 100755
index 0000000..8ffec7b
--- /dev/null
+++ b/test.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# This just ensures that the example code produces the expected output, which
+# is sufficient to verify the behavior we care about. Prints diff and exits
+# non-zero on error.
+
+./template example/vars example/text.tpl > output.tmp
+
+diff output.tmp - <<-eof
+ My favorite food is pizza, and my favorite beverage is coffee.
+ I'm going to have pizza and coffee for dinner tonight.
+
+ The first three numbers are 1, 2, and 3. 1 is the
+ smallest of the three.
+eof
+result=$?
+
+rm output.tmp
+
+exit $result