summaryrefslogtreecommitdiff
path: root/api_test
diff options
context:
space:
mode:
Diffstat (limited to 'api_test')
-rw-r--r--api_test/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/api_test/main.c b/api_test/main.c
index 2d65a46..9931581 100644
--- a/api_test/main.c
+++ b/api_test/main.c
@@ -522,6 +522,14 @@ utf8(test_batch_runner *runner)
test_continuation_byte(runner, "\xC2\x80");
test_continuation_byte(runner, "\xE0\xA0\x80");
test_continuation_byte(runner, "\xF0\x90\x80\x80");
+
+ // Test string containing null character
+ static const char string_with_null[] = "((((\0))))";
+ char *html = cmark_markdown_to_html(string_with_null,
+ sizeof(string_with_null) - 1);
+ STR_EQ(runner, html, "<p>((((" UTF8_REPL "))))</p>\n",
+ "utf8 with U+0000");
+ free(html);
}
static void