aboutsummaryrefslogtreecommitdiffstats
path: root/tests/check_renderer.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 01:35:37 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 01:35:37 -0300
commit2b6553f1ee3a6975b7511d01826f5807c49c132d (patch)
tree09257aee999552c559e659fd33a7c15120b2cb22 /tests/check_renderer.c
parent64e772c1125acadad8167fd5fd25b380f333ab86 (diff)
downloadblogc-2b6553f1ee3a6975b7511d01826f5807c49c132d.tar.gz
blogc-2b6553f1ee3a6975b7511d01826f5807c49c132d.tar.bz2
blogc-2b6553f1ee3a6975b7511d01826f5807c49c132d.zip
renderer: implemented if statements
Diffstat (limited to 'tests/check_renderer.c')
-rw-r--r--tests/check_renderer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/check_renderer.c b/tests/check_renderer.c
index e238610..b6201b4 100644
--- a/tests/check_renderer.c
+++ b/tests/check_renderer.c
@@ -67,7 +67,12 @@ test_render_entry(void **state)
"{% ifdef GUDA %}{{ GUDA }}{% endif %}\n"
"{% ifdef CHUNDA %}{{ CHUNDA }}{% endif %}\n"
"{% endblock %}\n"
- "{% block listing %}lol{% endblock %}\n";
+ "{% block listing %}lol{% endblock %}\n"
+ "{% if GUDA == \"zxc\" %}LOL{% endif %}\n"
+ "{% if GUDA != \"bola\" %}HEHE{% endif %}\n"
+ "{% if GUDA < \"zxd\" %}LOL2{% endif %}\n"
+ "{% if GUDA > \"zxd\" %}LOL3{% endif %}\n"
+ "{% if GUDA <= \"zxc\" %}LOL4{% endif %}\n";
blogc_error_t *err = NULL;
b_slist_t *l = blogc_template_parse(str, strlen(str), &err);
assert_non_null(l);
@@ -84,7 +89,12 @@ test_render_entry(void **state)
"zxc\n"
"\n"
"\n"
- "\n");
+ "\n"
+ "LOL\n"
+ "HEHE\n"
+ "LOL2\n"
+ "\n"
+ "LOL4\n");
blogc_template_free_stmts(l);
b_slist_free_full(s, (b_free_func_t) b_trie_free);
free(out);