diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-04-21 19:12:01 +0200 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-04-21 19:12:16 +0200 |
commit | 60f8be44dd876c221270a34989480936e716f5ab (patch) | |
tree | c773c6c1ffabce1dba83ce59c6e6d292d0fe9d12 /tests | |
parent | cf95aa88595184f51da4eeb06301e436a6a5f589 (diff) | |
download | blogc-60f8be44dd876c221270a34989480936e716f5ab.tar.gz blogc-60f8be44dd876c221270a34989480936e716f5ab.tar.bz2 blogc-60f8be44dd876c221270a34989480936e716f5ab.zip |
make: removed atom_legacy_entry_id setting
Diffstat (limited to 'tests')
-rw-r--r-- | tests/blogc-make/check_atom.c | 98 |
1 files changed, 14 insertions, 84 deletions
diff --git a/tests/blogc-make/check_atom.c b/tests/blogc-make/check_atom.c index a8fe4af..94c9a37 100644 --- a/tests/blogc-make/check_atom.c +++ b/tests/blogc-make/check_atom.c @@ -491,50 +491,15 @@ test_atom_legacy_entry_id_empty(void **state) bc_error_t *err = NULL; char *rv = bm_atom_deploy(settings, &err); - assert_non_null(rv); - assert_null(err); + assert_null(rv); + assert_non_null(err); - size_t cmp_len; - char *cmp = bc_file_get_contents(rv, true, &cmp_len, &err); + assert_int_equal(err->type, BLOGC_MAKE_ERROR_ATOM); + assert_string_equal(err->msg, + "'atom_legacy_entry_id' setting is not supported anymore. see " + "https://blogc.rgm.io/news/blogc-0.16.1/ for details"); - assert_non_null(cmp); - assert_null(err); - - assert_string_equal(cmp, - "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" - "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" - " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " - "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" - "{% else %}/index{% endif %}.xml</id>\n" - " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" - " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" - " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}{% ifdef FILTER_TAG %}" - "/{{ FILTER_TAG }}{% else %}/index{% endif %}.xml\" rel=\"self\" />\n" - " <author>\n" - " <name>{{ AUTHOR_NAME }}</name>\n" - " <email>{{ AUTHOR_EMAIL }}</email>\n" - " </author>\n" - " <subtitle type=\"text\">{{ SITE_TAGLINE }}</subtitle>\n" - " {% block listing %}\n" - " <entry>\n" - " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}/</id>\n" - " <updated>{{ DATE_FORMATTED }}</updated>\n" - " <published>{{ DATE_FORMATTED }}</published>\n" - " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/{{ FILENAME }}.html\" />\n" - " <author>\n" - " <name>{{ AUTHOR_NAME }}</name>\n" - " <email>{{ AUTHOR_EMAIL }}</email>\n" - " </author>\n" - " <content type=\"html\"><![CDATA[{{ CONTENT }}]]></content>\n" - " </entry>\n" - " {% endblock %}\n" - "</feed>\n"); - - free(cmp); - bm_atom_destroy(rv); - free(rv); + bc_error_free(err); bc_trie_free(settings->settings); free(settings); } @@ -554,50 +519,15 @@ test_atom_legacy_entry_id(void **state) bc_error_t *err = NULL; char *rv = bm_atom_deploy(settings, &err); - assert_non_null(rv); - assert_null(err); + assert_null(rv); + assert_non_null(err); - size_t cmp_len; - char *cmp = bc_file_get_contents(rv, true, &cmp_len, &err); + assert_int_equal(err->type, BLOGC_MAKE_ERROR_ATOM); + assert_string_equal(err->msg, + "'atom_legacy_entry_id' setting is not supported anymore. see " + "https://blogc.rgm.io/news/blogc-0.16.1/ for details"); - assert_non_null(cmp); - assert_null(err); - - assert_string_equal(cmp, - "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" - "<feed xmlns=\"http://www.w3.org/2005/Atom\">\n" - " <title type=\"text\">{{ SITE_TITLE }}{% ifdef FILTER_TAG %} - " - "{{ FILTER_TAG }}{% endif %}</title>\n" - " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}/{{ FILTER_TAG }}" - "{% endif %}.xml</id>\n" - " <updated>{{ DATE_FIRST_FORMATTED }}</updated>\n" - " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/\" />\n" - " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/atom{% ifdef FILTER_TAG %}" - "/{{ FILTER_TAG }}{% endif %}.xml\" rel=\"self\" />\n" - " <author>\n" - " <name>{{ AUTHOR_NAME }}</name>\n" - " <email>{{ AUTHOR_EMAIL }}</email>\n" - " </author>\n" - " <subtitle type=\"text\">{{ SITE_TAGLINE }}</subtitle>\n" - " {% block listing %}\n" - " <entry>\n" - " <title type=\"text\">{{ TITLE }}</title>\n" - " <id>{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}/</id>\n" - " <updated>{{ DATE_FORMATTED }}</updated>\n" - " <published>{{ DATE_FORMATTED }}</published>\n" - " <link href=\"{{ BASE_DOMAIN }}{{ BASE_URL }}/post/{{ FILENAME }}.html\" />\n" - " <author>\n" - " <name>{{ AUTHOR_NAME }}</name>\n" - " <email>{{ AUTHOR_EMAIL }}</email>\n" - " </author>\n" - " <content type=\"html\"><![CDATA[{{ CONTENT }}]]></content>\n" - " </entry>\n" - " {% endblock %}\n" - "</feed>\n"); - - free(cmp); - bm_atom_destroy(rv); - free(rv); + bc_error_free(err); bc_trie_free(settings->settings); free(settings); } |