From 579c1d8c1f9a6b5bfc16d9f0b02dbab2e0acb0ed Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Wed, 4 Nov 2015 03:30:58 -0200 Subject: content-parser: random parser fixes --- tests/check_content_parser.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'tests/check_content_parser.c') diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c index 994e900..dc3485e 100644 --- a/tests/check_content_parser.c +++ b/tests/check_content_parser.c @@ -1135,6 +1135,14 @@ test_content_parse_invalid_blockquote(void **state) "> bola\n" "> foo

\n"); free(html); + html = blogc_content_parse( + "> asd\n" + "> bola", NULL); + assert_non_null(html); + assert_string_equal(html, + "

> asd\n" + "> bola

\n"); + free(html); } @@ -1151,6 +1159,16 @@ test_content_parse_invalid_code(void **state) " bola\n" " foo

\n"); free(html); + html = blogc_content_parse( + " asd\n" + " bola\n" + " foo", NULL); + assert_non_null(html); + assert_string_equal(html, + "

asd\n" + " bola\n" + " foo

\n"); + free(html); } @@ -1196,7 +1214,8 @@ test_content_parse_invalid_unordered_list(void **state) assert_non_null(html); assert_string_equal(html, "

asd\n" - "1. qwe

\n"); + "1. qwe" + "

\n"); free(html); html = blogc_content_parse( "* asd\n" @@ -1204,7 +1223,8 @@ test_content_parse_invalid_unordered_list(void **state) assert_non_null(html); assert_string_equal(html, "

asd\n" - "1. qwe

\n"); + "1. qwe" + "

\n"); free(html); html = blogc_content_parse( "chunda\n" @@ -1250,7 +1270,8 @@ test_content_parse_invalid_ordered_list(void **state) assert_non_null(html); assert_string_equal(html, "

1. asd\n" - " qwe

\n"); + " qwe" + "

\n"); free(html); html = blogc_content_parse( "1. asd\n" @@ -1258,7 +1279,8 @@ test_content_parse_invalid_ordered_list(void **state) assert_non_null(html); assert_string_equal(html, "

1. asd\n" - " qwe

\n"); + " qwe" + "

\n"); free(html); html = blogc_content_parse( "chunda\n" @@ -1303,6 +1325,10 @@ test_content_parse_invalid_ordered_list(void **state) assert_non_null(html); assert_string_equal(html, "

1.

\n"); free(html); + html = blogc_content_parse("1 ", NULL); + assert_non_null(html); + assert_string_equal(html, "

1

\n"); + free(html); } -- cgit v1.2.3-18-g5258