diff options
author | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-13 11:26:48 +0100 |
---|---|---|
committer | Danny van Kooten <dannyvankooten@users.noreply.github.com> | 2020-03-13 11:26:48 +0100 |
commit | 1e8fa138696f28cf712d50d85b91afce1faec655 (patch) | |
tree | 74f33703c9ec2e26ce3359b536529fe488ba3265 /tests/test_template.c | |
parent | c9a5143b2aa9b92d1fbff4c804f058cf0e84f953 (diff) | |
download | unja-1e8fa138696f28cf712d50d85b91afce1faec655.tar.gz unja-1e8fa138696f28cf712d50d85b91afce1faec655.zip |
add whitespace control for statements
Diffstat (limited to 'tests/test_template.c')
-rw-r--r-- | tests/test_template.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_template.c b/tests/test_template.c index d9f74ac..90190cc 100644 --- a/tests/test_template.c +++ b/tests/test_template.c @@ -20,6 +20,16 @@ TEST(var) { free(output); } +TEST(var_whitespace) { + char *input = "Hello \n{{-name -}}\n."; + struct hashmap *ctx = hashmap_new(); + hashmap_insert(ctx, "name", "world"); + char *output = template(input, ctx); + assert_str(output, "Helloworld."); + hashmap_free(ctx); + free(output); +} + TEST(multiline) { char *input = "Hello {{name}}.\nL2"; struct hashmap *ctx = hashmap_new(); |