From f634a3ff3583f2e0d533db3d4e2d8aef9ea7e9c8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 3 Jun 2015 14:47:16 +0200 Subject: Added test for different line endings to api_test. --- api_test/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'api_test') diff --git a/api_test/main.c b/api_test/main.c index 029a879..01df51d 100644 --- a/api_test/main.c +++ b/api_test/main.c @@ -665,6 +665,20 @@ test_continuation_byte(test_batch_runner *runner, const char *utf8) } } +static void +line_endings(test_batch_runner *runner) +{ + // Test list with different line endings + static const char list_with_endings[] = + "- a\n- b\r\n- c\r- d"; + char *html = cmark_markdown_to_html(list_with_endings, + sizeof(list_with_endings) - 1, + CMARK_OPT_DEFAULT); + STR_EQ(runner, html, "\n", + "list with different line endings"); + free(html); +} + static void numeric_entities(test_batch_runner *runner) { @@ -724,6 +738,7 @@ int main() { parser(runner); render_html(runner); utf8(runner); + line_endings(runner); numeric_entities(runner); test_cplusplus(runner); -- cgit v1.2.3