Test group with choice in element declaration

This commit is contained in:
Rhodri James 2017-03-13 14:57:18 +00:00 committed by Sebastian Pipping
parent da5c188913
commit 3c526f6d6c

View File

@ -4235,6 +4235,31 @@ START_TEST(test_nested_groups)
}
END_TEST
START_TEST(test_group_choice)
{
const char *text =
"<!DOCTYPE doc [\n"
"<!ELEMENT doc (a|b|c)+>\n"
"<!ELEMENT a EMPTY>\n"
"<!ELEMENT b (#PCDATA)>\n"
"<!ELEMENT c ANY>\n"
"]>\n"
"<doc>\n"
"<a/>\n"
"<b attr='foo'>This is a foo</b>\n"
"<c></c>\n"
"</doc>\n";
XML_SetElementDeclHandler(parser, dummy_element_decl_handler);
dummy_handler_flags = 0;
if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
if (dummy_handler_flags != DUMMY_ELEMENT_DECL_HANDLER_FLAG)
fail("Element handler flag not raised");
}
END_TEST
/*
* Namespaces tests.
*/
@ -7259,6 +7284,7 @@ make_suite(void)
tcase_add_test(tc_basic, test_dtd_stop_processing);
tcase_add_test(tc_basic, test_public_notation_no_sysid);
tcase_add_test(tc_basic, test_nested_groups);
tcase_add_test(tc_basic, test_group_choice);
suite_add_tcase(s, tc_namespace);
tcase_add_checked_fixture(tc_namespace,