diff options
author | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-20 14:52:20 +0100 |
---|---|---|
committer | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-20 14:52:20 +0100 |
commit | ef00aa15f8eef283dadc28aba7f36ea918d61b15 (patch) | |
tree | f7e94a0fd4c91690e405dab619839aaef10f8b83 /tests | |
parent | f64c97341cedf668c6e7ae7cad818bae6fdb90bd (diff) | |
download | unja-ef00aa15f8eef283dadc28aba7f36ea918d61b15.tar.gz unja-ef00aa15f8eef283dadc28aba7f36ea918d61b15.zip |
add filter: wordcount
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_template.c | 12 |
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 |