aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_template.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_template.c b/tests/test_template.c
index 51c8fad..6b2ca12 100644
--- a/tests/test_template.c
+++ b/tests/test_template.c
@@ -472,4 +472,16 @@ TEST(filter_lower) {
free(output);
}
+TEST(filter_wordcount) {
+ char *input = "{{ \"Hello World. How are we?\" | wordcount }}";
+ char *output = template_string(input, NULL);
+ assert_str(output, "5");
+ free(output);
+
+ input = "{% if \"Hello World. How are we?\" | wordcount > 4 %}1{% endif %}";
+ output = template_string(input, NULL);
+ assert_str(output, "1");
+ free(output);
+}
+
END_TESTS \ No newline at end of file