From a5ba5add1d72874fd40168eac54ed39e7b82bf49 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Mon, 24 Nov 2014 22:46:20 +0100 Subject: Add test for input containing null character --- api_test/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'api_test') 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, "

((((" UTF8_REPL "))))

\n", + "utf8 with U+0000"); + free(html); } static void -- cgit v1.2.3