diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-24 22:46:20 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2014-11-24 22:46:20 +0100 |
commit | a5ba5add1d72874fd40168eac54ed39e7b82bf49 (patch) | |
tree | a9619d7e90846b60588c1948648888f9f4356bf9 /api_test | |
parent | ff9c0dcecd1314b820bf7d2584990c26c0e28909 (diff) |
Add test for input containing null character
Diffstat (limited to 'api_test')
-rw-r--r-- | api_test/main.c | 8 |
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 |