From 31d376735ab2aaaed0934edcce676113f83a7de7 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 21 Feb 2016 04:58:13 +0100 Subject: content-parser: fixed parser bug when handling links do not handle something like this as a valid link: [asd] asd (asd) --- tests/check_content_parser.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/check_content_parser.c') diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c index e8e412a..73bbe9b 100644 --- a/tests/check_content_parser.c +++ b/tests/check_content_parser.c @@ -1487,6 +1487,14 @@ test_content_parse_inline_link(void **state) assert_non_null(html); assert_string_equal(html, "bola\n"); free(html); + html = blogc_content_parse_inline("[bola]\r\n(http://example.org/)\n"); + assert_non_null(html); + assert_string_equal(html, "bola\n"); + free(html); + html = blogc_content_parse_inline("[bola] \r\n (http://example.org/)\n"); + assert_non_null(html); + assert_string_equal(html, "bola\n"); + free(html); html = blogc_content_parse_inline("[bo\nla](http://example.org/)\n"); assert_non_null(html); assert_string_equal(html, "bo\nla\n"); @@ -1505,6 +1513,10 @@ test_content_parse_inline_link(void **state) assert_string_equal(html, "test suite!)\n" "depends on cmocka, though.\n"); free(html); + html = blogc_content_parse_inline("asd [bola]chunda(1234)"); + assert_non_null(html); + assert_string_equal(html, "asd [bola]chunda(1234)"); + free(html); // "invalid" html = blogc_content_parse_inline("[bola](\nhttp://example.org/)\n"); assert_non_null(html); -- cgit v1.2.3-18-g5258