From fa016a15156bf8122b2d3dccaecca53f471d6ecb Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Tue, 21 Apr 2015 15:42:16 -0300 Subject: refactored blocks - changed block names: - single_source -> entry - multiple_sources -> listing - multiple_sources_once -> listing_once - added -t cli option, to build listing pages, instead of guess it from the number of source files provided. --- tests/check_template_parser.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'tests/check_template_parser.c') diff --git a/tests/check_template_parser.c b/tests/check_template_parser.c index 9d67fe3..f4c0825 100644 --- a/tests/check_template_parser.c +++ b/tests/check_template_parser.c @@ -39,20 +39,20 @@ test_template_parse(void **state) const char *a = "Test\n" "\n" - " {% block single_source %}\n" + " {% block entry %}\n" "{% if CHUNDA %}\n" "bola\n" "{% endif %}\n" "{% endblock %}\n" - "{% block multiple_sources %}{{ BOLA }}{% endblock %}\n" - "{% block multiple_sources_once %}asd{% endblock %}\n"; + "{% block listing %}{{ BOLA }}{% endblock %}\n" + "{% block listing_once %}asd{% endblock %}\n"; blogc_error_t *err = NULL; b_slist_t *stmts = blogc_template_parse(a, strlen(a), &err); assert_null(err); assert_non_null(stmts); blogc_assert_template_stmt(stmts, "Test\n\n ", BLOGC_TEMPLATE_CONTENT_STMT); - blogc_assert_template_stmt(stmts->next, "single_source", + blogc_assert_template_stmt(stmts->next, "entry", BLOGC_TEMPLATE_BLOCK_STMT); blogc_assert_template_stmt(stmts->next->next, "\n", BLOGC_TEMPLATE_CONTENT_STMT); @@ -67,7 +67,7 @@ test_template_parse(void **state) b_slist_t *tmp = stmts->next->next->next->next->next->next->next; blogc_assert_template_stmt(tmp, NULL, BLOGC_TEMPLATE_ENDBLOCK_STMT); blogc_assert_template_stmt(tmp->next, "\n", BLOGC_TEMPLATE_CONTENT_STMT); - blogc_assert_template_stmt(tmp->next->next, "multiple_sources", + blogc_assert_template_stmt(tmp->next->next, "listing", BLOGC_TEMPLATE_BLOCK_STMT); blogc_assert_template_stmt(tmp->next->next->next, "BOLA", BLOGC_TEMPLATE_VARIABLE_STMT); @@ -76,7 +76,7 @@ test_template_parse(void **state) blogc_assert_template_stmt(tmp->next->next->next->next->next, "\n", BLOGC_TEMPLATE_CONTENT_STMT); blogc_assert_template_stmt(tmp->next->next->next->next->next->next, - "multiple_sources_once", BLOGC_TEMPLATE_BLOCK_STMT); + "listing_once", BLOGC_TEMPLATE_BLOCK_STMT); blogc_assert_template_stmt(tmp->next->next->next->next->next->next->next, "asd", BLOGC_TEMPLATE_CONTENT_STMT); blogc_assert_template_stmt(tmp->next->next->next->next->next->next->next->next, @@ -94,24 +94,24 @@ test_template_parse_html(void **state) const char *a = "\n" " \n" - " {% block single_source %}\n" + " {% block entry %}\n" " My cool blog >> {{ TITLE }}\n" " {% endblock %}\n" - " {% block multiple_sources_once %}\n" + " {% block listing_once %}\n" " My cool blog - Main page\n" " {% endblock %}\n" " \n" " \n" "

My cool blog

\n" - " {% block single_source %}\n" + " {% block entry %}\n" "

{{ TITLE }}

\n" " {% if DATE %}

Published in: {{ DATE }}

{% endif %}\n" "
{{ CONTENT }}
\n" " {% endblock %}\n" - " {% block multiple_sources_once %}{% endblock %}\n" " \n" "\n"; blogc_error_t *err = NULL; @@ -120,7 +120,7 @@ test_template_parse_html(void **state) assert_non_null(stmts); blogc_assert_template_stmt(stmts, "\n \n ", BLOGC_TEMPLATE_CONTENT_STMT); - blogc_assert_template_stmt(stmts->next, "single_source", + blogc_assert_template_stmt(stmts->next, "entry", BLOGC_TEMPLATE_BLOCK_STMT); blogc_assert_template_stmt(stmts->next->next, "\n My cool blog >> ", BLOGC_TEMPLATE_CONTENT_STMT); @@ -133,7 +133,7 @@ test_template_parse_html(void **state) blogc_assert_template_stmt(stmts->next->next->next->next->next->next, "\n ", BLOGC_TEMPLATE_CONTENT_STMT); blogc_assert_template_stmt(stmts->next->next->next->next->next->next->next, - "multiple_sources_once", BLOGC_TEMPLATE_BLOCK_STMT); + "listing_once", BLOGC_TEMPLATE_BLOCK_STMT); b_slist_t *tmp = stmts->next->next->next->next->next->next->next->next; blogc_assert_template_stmt(tmp, "\n <title>My cool blog - Main page\n ", @@ -142,7 +142,7 @@ test_template_parse_html(void **state) blogc_assert_template_stmt(tmp->next->next, "\n \n \n

My cool blog

\n ", BLOGC_TEMPLATE_CONTENT_STMT); - blogc_assert_template_stmt(tmp->next->next->next, "single_source", + blogc_assert_template_stmt(tmp->next->next->next, "entry", BLOGC_TEMPLATE_BLOCK_STMT); blogc_assert_template_stmt(tmp->next->next->next->next, "\n

", BLOGC_TEMPLATE_CONTENT_STMT); @@ -170,7 +170,7 @@ test_template_parse_html(void **state) NULL, BLOGC_TEMPLATE_ENDBLOCK_STMT); tmp = tmp->next->next->next->next->next->next->next->next; blogc_assert_template_stmt(tmp, "\n ", BLOGC_TEMPLATE_CONTENT_STMT); - blogc_assert_template_stmt(tmp->next, "multiple_sources_once", + blogc_assert_template_stmt(tmp->next, "listing_once", BLOGC_TEMPLATE_BLOCK_STMT); blogc_assert_template_stmt(tmp->next->next, "", BLOGC_TEMPLATE_CONTENT_STMT); -- cgit v1.2.3-18-g5258