aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 19:12:00 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-05-18 19:12:00 -0300
commitcbefb0ffb583a877a082bc336f2d61be7e773a5d (patch)
treeb1df898f575c32d77a0939eda0af02d336143802 /tests
parentae19d4d1d14efee57afe85ba90048e81120ec68a (diff)
downloadblogc-cbefb0ffb583a877a082bc336f2d61be7e773a5d.tar.gz
blogc-cbefb0ffb583a877a082bc336f2d61be7e773a5d.tar.bz2
blogc-cbefb0ffb583a877a082bc336f2d61be7e773a5d.zip
content-parser: fix and test horizontal rules
Diffstat (limited to 'tests')
-rw-r--r--tests/check_content_parser.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c
index 0053051..390d516 100644
--- a/tests/check_content_parser.c
+++ b/tests/check_content_parser.c
@@ -216,6 +216,64 @@ test_content_parse_code(void **state)
void
+test_content_parse_horizontal_rule(void **state)
+{
+ char *html = blogc_content_parse("bola\nguda\n\n**");
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<p>bola\n"
+ "guda</p>\n"
+ "<hr />\n");
+ free(html);
+ html = blogc_content_parse("bola\nguda\n\n++++");
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<p>bola\n"
+ "guda</p>\n"
+ "<hr />\n");
+ free(html);
+ html = blogc_content_parse("bola\nguda\n\n--\n");
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<p>bola\n"
+ "guda</p>\n"
+ "<hr />\n");
+ free(html);
+ html = blogc_content_parse("bola\nguda\n\n****\n");
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<p>bola\n"
+ "guda</p>\n"
+ "<hr />\n");
+ free(html);
+ html = blogc_content_parse(
+ "bola\n"
+ "\n"
+ "**\n"
+ "\n"
+ "chunda\n");
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<p>bola</p>\n"
+ "<hr />\n"
+ "<p>chunda</p>\n");
+ free(html);
+ html = blogc_content_parse(
+ "bola\n"
+ "\n"
+ "----\n"
+ "\n"
+ "chunda\n");
+ assert_non_null(html);
+ assert_string_equal(html,
+ "<p>bola</p>\n"
+ "<hr />\n"
+ "<p>chunda</p>\n");
+ free(html);
+}
+
+
+void
test_content_parse_invalid_header(void **state)
{
char *html = blogc_content_parse(
@@ -308,6 +366,7 @@ main(void)
unit_test(test_content_parse_html),
unit_test(test_content_parse_blockquote),
unit_test(test_content_parse_code),
+ unit_test(test_content_parse_horizontal_rule),
unit_test(test_content_parse_invalid_header),
unit_test(test_content_parse_invalid_header_empty),
unit_test(test_content_parse_invalid_blockquote),