aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_template.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_template.c b/tests/test_template.c
index 758f7fb..b0f03ff 100644
--- a/tests/test_template.c
+++ b/tests/test_template.c
@@ -454,4 +454,15 @@ TEST(inheritance_depth_2) {
env_free(env);
}
+TEST(filter) {
+ char *input = "{{ text | trim }}";
+ struct hashmap *ctx = hashmap_new();
+ char *text = "\nHello world\n";
+ hashmap_insert(ctx, "text", text);
+ char *output = template_string(input, ctx);
+ assert_str(output, "Hello world");
+ hashmap_free(ctx);
+ free(output);
+}
+
END_TESTS \ No newline at end of file