diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-10-07 19:57:25 -0300 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-10-07 19:57:25 -0300 |
commit | b54d7c65021d7d65c6a2b0088a6c3591e10ccfb3 (patch) | |
tree | d7e0a90501df18458c999cdeace1b963125e9a60 /tests | |
parent | 1769387fb663d215871a901356dcd484c9587e58 (diff) | |
download | blogc-b54d7c65021d7d65c6a2b0088a6c3591e10ccfb3.tar.gz blogc-b54d7c65021d7d65c6a2b0088a6c3591e10ccfb3.tar.bz2 blogc-b54d7c65021d7d65c6a2b0088a6c3591e10ccfb3.zip |
renderer: accept empty list of files with -l
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check_renderer.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/check_renderer.c b/tests/check_renderer.c index 154a8f0..fbe38de 100644 --- a/tests/check_renderer.c +++ b/tests/check_renderer.c @@ -143,6 +143,35 @@ test_render_listing(void **state) static void +test_render_listing_empty(void **state) +{ + const char *str = + "foo\n" + "{% block listing_once %}fuuu{% endblock %}\n" + "{% block entry %}\n" + "{% ifdef GUDA %}{{ GUDA }}{% endif %}\n" + "{% ifdef CHUNDA %}{{ CHUNDA }}{% endif %}\n" + "{% endblock %}\n" + "{% block listing %}\n" + "{% ifdef DATE_FORMATTED %}{{ DATE_FORMATTED }}{% endif %}\n" + "bola: {% ifdef BOLA %}{{ BOLA }}{% endif %}\n" + "{% endblock %}\n"; + blogc_error_t *err = NULL; + b_slist_t *l = blogc_template_parse(str, strlen(str), &err); + assert_non_null(l); + assert_null(err); + char *out = blogc_render(l, NULL, NULL, true); + assert_string_equal(out, + "foo\n" + "fuuu\n" + "\n" + "\n"); + blogc_template_free_stmts(l); + free(out); +} + + +static void test_render_ifdef(void **state) { const char *str = @@ -685,6 +714,7 @@ main(void) const UnitTest tests[] = { unit_test(test_render_entry), unit_test(test_render_listing), + unit_test(test_render_listing_empty), unit_test(test_render_ifdef), unit_test(test_render_ifdef2), unit_test(test_render_ifdef3), |