summaryrefslogtreecommitdiff
path: root/api_test
diff options
context:
space:
mode:
authorYuki Izumi <kivikakk@github.com>2016-10-11 01:43:26 +1100
committerYuki Izumi <kivikakk@github.com>2016-10-11 01:43:26 +1100
commit8f80fb336984ccd1f42076c722caec2292092904 (patch)
treefe5da7b4585a98325ebc8e841ff0613f2853a882 /api_test
parente89187b0604eff3a8251a902bfbbdb3cd7ff415b (diff)
Add test for NUL-LF sequence
Diffstat (limited to 'api_test')
-rw-r--r--api_test/main.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/api_test/main.c b/api_test/main.c
index d493e00..d87e446 100644
--- a/api_test/main.c
+++ b/api_test/main.c
@@ -732,6 +732,13 @@ static void utf8(test_batch_runner *runner) {
string_with_null, sizeof(string_with_null) - 1, CMARK_OPT_DEFAULT);
STR_EQ(runner, html, "<p>((((" UTF8_REPL "))))</p>\n", "utf8 with U+0000");
free(html);
+
+ // Test NUL followed by newline
+ static const char string_with_nul_lf[] = "```\n\0\n```\n";
+ html = cmark_markdown_to_html(
+ string_with_nul_lf, sizeof(string_with_nul_lf) - 1, CMARK_OPT_DEFAULT);
+ STR_EQ(runner, html, "<pre><code>\xef\xbf\xbd\n</code></pre>\n", "utf8 with \\0\\n");
+ free(html);
}
static void test_char(test_batch_runner *runner, int valid, const char *utf8,