bug/49336298 extra endtags need report error when content parsing

This commit is contained in:
obdev
2023-05-04 08:11:50 +00:00
committed by ob-robot
parent 1fd32d2c33
commit 1764237a55

View File

@ -2699,6 +2699,23 @@ TEST_F(TestXmlParser, test_xml_bin_to_binary)
std::cout << "total " << text.length() << std::endl;
}
TEST_F(TestXmlParser, test_endtags_content)
{
int ret = 0;
common::ObString xml_text(
"<customerName> Acme Enterprises</customerName>"
"<itemNo>32987457</itemNo>"
"</aseOrder>"
);
ObArenaAllocator allocator(ObModIds::TEST);
ObXmlDocument* doc = nullptr;
ObMulModeMemCtx* ctx = nullptr;
ASSERT_EQ(ObXmlUtil::create_mulmode_tree_context(&allocator, ctx), OB_SUCCESS);
ret = ObXmlParserUtils::parse_content_text(ctx, xml_text, doc);
ASSERT_EQ(OB_ERR_PARSER_SYNTAX, ret);
}
// class TestMemoryXmlParser : public ::testing::Test {
// public:
// TestMemoryXmlParser()