MCPcopy Create free account
hub / github.com/commonmark/cmark / numeric_entities

Function numeric_entities

api_test/main.c:866–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

864}
865
866static void numeric_entities(test_batch_runner *runner) {
867 test_md_to_html(runner, "&#0;", "<p>" UTF8_REPL "</p>\n",
868 "Invalid numeric entity 0");
869 test_md_to_html(runner, "&#55295;", "<p>\xED\x9F\xBF</p>\n",
870 "Valid numeric entity 0xD7FF");
871 test_md_to_html(runner, "&#xD800;", "<p>" UTF8_REPL "</p>\n",
872 "Invalid numeric entity 0xD800");
873 test_md_to_html(runner, "&#xDFFF;", "<p>" UTF8_REPL "</p>\n",
874 "Invalid numeric entity 0xDFFF");
875 test_md_to_html(runner, "&#57344;", "<p>\xEE\x80\x80</p>\n",
876 "Valid numeric entity 0xE000");
877 test_md_to_html(runner, "&#x10FFFF;", "<p>\xF4\x8F\xBF\xBF</p>\n",
878 "Valid numeric entity 0x10FFFF");
879 test_md_to_html(runner, "&#x110000;", "<p>" UTF8_REPL "</p>\n",
880 "Invalid numeric entity 0x110000");
881 test_md_to_html(runner, "&#x80000000;", "<p>&amp;#x80000000;</p>\n",
882 "Invalid numeric entity 0x80000000");
883 test_md_to_html(runner, "&#xFFFFFFFF;", "<p>&amp;#xFFFFFFFF;</p>\n",
884 "Invalid numeric entity 0xFFFFFFFF");
885 test_md_to_html(runner, "&#99999999;", "<p>&amp;#99999999;</p>\n",
886 "Invalid numeric entity 99999999");
887
888 test_md_to_html(runner, "&#;", "<p>&amp;#;</p>\n",
889 "Min decimal entity length");
890 test_md_to_html(runner, "&#x;", "<p>&amp;#x;</p>\n",
891 "Min hexadecimal entity length");
892 test_md_to_html(runner, "&#999999999;", "<p>&amp;#999999999;</p>\n",
893 "Max decimal entity length");
894 test_md_to_html(runner, "&#x000000041;", "<p>&amp;#x000000041;</p>\n",
895 "Max hexadecimal entity length");
896}
897
898static void test_safe(test_batch_runner *runner) {
899 // Test safe mode

Callers 1

mainFunction · 0.85

Calls 1

test_md_to_htmlFunction · 0.85

Tested by

no test coverage detected