From 001c16ac605ee65f5688534e42c10395db3f0d5a Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Sun, 17 Apr 2016 04:01:51 +0200 Subject: content-parser: do not convert -- and --- to &ndash and &mdash inside code --- tests/check_content_parser.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'tests') diff --git a/tests/check_content_parser.c b/tests/check_content_parser.c index b20f8d0..ea3a9a2 100644 --- a/tests/check_content_parser.c +++ b/tests/check_content_parser.c @@ -1751,6 +1751,36 @@ test_content_parse_inline_line_break_crlf(void **state) } +static void +test_content_parse_inline_endash_emdash(void **state) +{ + char *html = blogc_content_parse_inline("foo -- bar"); + assert_non_null(html); + assert_string_equal(html, "foo – bar"); + free(html); + html = blogc_content_parse_inline("foo --- bar"); + assert_non_null(html); + assert_string_equal(html, "foo — bar"); + free(html); + html = blogc_content_parse_inline("`foo -- bar`"); + assert_non_null(html); + assert_string_equal(html, "foo -- bar"); + free(html); + html = blogc_content_parse_inline("`foo --- bar`"); + assert_non_null(html); + assert_string_equal(html, "foo --- bar"); + free(html); + html = blogc_content_parse_inline("``foo -- bar``"); + assert_non_null(html); + assert_string_equal(html, "foo -- bar"); + free(html); + html = blogc_content_parse_inline("``foo --- bar``"); + assert_non_null(html); + assert_string_equal(html, "foo --- bar"); + free(html); +} + + int main(void) { @@ -1793,6 +1823,7 @@ main(void) unit_test(test_content_parse_inline_image), unit_test(test_content_parse_inline_line_break), unit_test(test_content_parse_inline_line_break_crlf), + unit_test(test_content_parse_inline_endash_emdash), }; return run_tests(tests); } -- cgit v1.2.3-18-g5258