diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-09 01:23:33 -0300 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2015-05-09 01:23:33 -0300 |
commit | c266bd93852b156b1436e203bb0f691139274f3d (patch) | |
tree | 3f549cce5aeb4e6273981b131c3cc9ae0e4883cd /tests/check_renderer.c | |
parent | 0a63da7081bd1227c5788000349cf7ac03f8e107 (diff) | |
download | blogc-c266bd93852b156b1436e203bb0f691139274f3d.tar.gz blogc-c266bd93852b156b1436e203bb0f691139274f3d.tar.bz2 blogc-c266bd93852b156b1436e203bb0f691139274f3d.zip |
added global variables with date/filename on first and last post
Diffstat (limited to 'tests/check_renderer.c')
-rw-r--r-- | tests/check_renderer.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tests/check_renderer.c b/tests/check_renderer.c index 3d8a205..4c77057 100644 --- a/tests/check_renderer.c +++ b/tests/check_renderer.c @@ -39,6 +39,7 @@ create_sources(unsigned int count) "ahahahahahahahaha2", "BOLA: asd3\n" "GUDA: zxc3\n" + "DATE: 2013-01-02 03:04:05\n" "-----\n" "ahahahahahahahaha3", }; @@ -122,7 +123,7 @@ test_render_listing(void **state) "2014-02-03 04:05:06\n" "bola: asd2\n" "\n" - "\n" + "2013-01-02 03:04:05\n" "bola: asd3\n" "\n"); blogc_template_free_stmts(l); @@ -413,9 +414,8 @@ test_format_date(void **state) b_trie_t *g = b_trie_new(free); b_trie_insert(g, "DATE_FORMAT", b_strdup("%H -- %M")); b_trie_t *l = b_trie_new(free); - b_trie_insert(l, "DATE", b_strdup("2015-01-02 03:04:05")); b_trie_insert(l, "DATE_FORMAT", b_strdup("%R")); - char *date = blogc_format_date(g, l); + char *date = blogc_format_date("2015-01-02 03:04:05", g, l); assert_string_equal(date, "03:04"); free(date); b_trie_free(g); @@ -429,8 +429,7 @@ test_format_date_with_global_format(void **state) b_trie_t *g = b_trie_new(free); b_trie_insert(g, "DATE_FORMAT", b_strdup("%H -- %M")); b_trie_t *l = b_trie_new(free); - b_trie_insert(l, "DATE", b_strdup("2015-01-02 03:04:05")); - char *date = blogc_format_date(g, l); + char *date = blogc_format_date("2015-01-02 03:04:05", g, l); assert_string_equal(date, "03 -- 04"); free(date); b_trie_free(g); @@ -443,8 +442,7 @@ test_format_date_without_format(void **state) { b_trie_t *g = b_trie_new(free); b_trie_t *l = b_trie_new(free); - b_trie_insert(l, "DATE", b_strdup("2015-01-02 03:04:05")); - char *date = blogc_format_date(g, l); + char *date = blogc_format_date("2015-01-02 03:04:05", g, l); assert_string_equal(date, "2015-01-02 03:04:05"); free(date); b_trie_free(g); @@ -457,7 +455,7 @@ test_format_date_without_date(void **state) { b_trie_t *g = b_trie_new(free); b_trie_t *l = b_trie_new(free); - char *date = blogc_format_date(g, l); + char *date = blogc_format_date(NULL, g, l); assert_null(date); free(date); b_trie_free(g); |