diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2015-06-03 14:47:16 +0200 | 
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2015-06-04 00:11:05 +0200 | 
| commit | f634a3ff3583f2e0d533db3d4e2d8aef9ea7e9c8 (patch) | |
| tree | 317267dc7de5bdbcaa379e658f4a8804c848488a /api_test | |
| parent | bd3b24523fe30934c287698c53b4f2623557fa58 (diff) | |
Added test for different line endings to api_test.
Diffstat (limited to 'api_test')
| -rw-r--r-- | api_test/main.c | 15 | 
1 files changed, 15 insertions, 0 deletions
| 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 @@ -666,6 +666,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, "<ul>\n<li>a</li>\n<li>b</li>\n<li>c</li>\n<li>d</li>\n</ul>\n", +	       "list with different line endings"); +	free(html); +} + +static void  numeric_entities(test_batch_runner *runner)  {  	test_md_to_html(runner, "�", "<p>" UTF8_REPL "</p>\n", @@ -724,6 +738,7 @@ int main() {  	parser(runner);  	render_html(runner);  	utf8(runner); +	line_endings(runner);  	numeric_entities(runner);  	test_cplusplus(runner); | 
