Test that more than one colon in an element name is rejected

This commit is contained in:
Rhodri James 2017-06-15 18:15:51 +01:00 committed by Sebastian Pipping
parent 9f718ef37c
commit 98c1385bba

View File

@ -6790,6 +6790,16 @@ START_TEST(test_ns_double_colon)
} }
END_TEST END_TEST
START_TEST(test_ns_double_colon_element)
{
const char *text =
"<foo:bar:e xmlns:foo='http://example.org/' />";
expect_failure(text, XML_ERROR_INVALID_TOKEN,
"Double colon in element name not faulted");
}
END_TEST
/* Test that non-name characters after a colon are rejected */ /* Test that non-name characters after a colon are rejected */
START_TEST(test_ns_bad_attr_leafname) START_TEST(test_ns_bad_attr_leafname)
{ {
@ -11541,6 +11551,7 @@ make_suite(void)
tcase_add_test(tc_namespace, test_ns_extremely_long_prefix); tcase_add_test(tc_namespace, test_ns_extremely_long_prefix);
tcase_add_test(tc_namespace, test_ns_unknown_encoding_success); tcase_add_test(tc_namespace, test_ns_unknown_encoding_success);
tcase_add_test(tc_namespace, test_ns_double_colon); tcase_add_test(tc_namespace, test_ns_double_colon);
tcase_add_test(tc_namespace, test_ns_double_colon_element);
tcase_add_test(tc_namespace, test_ns_bad_attr_leafname); tcase_add_test(tc_namespace, test_ns_bad_attr_leafname);
tcase_add_test(tc_namespace, test_ns_utf16_leafname); tcase_add_test(tc_namespace, test_ns_utf16_leafname);