From 5e1f3cf32c9f648929c5c025821ab43d1553878d Mon Sep 17 00:00:00 2001 From: "arseny.kapoulkine" Date: Mon, 10 May 2010 20:35:06 +0000 Subject: More DOCTYPE tests git-svn-id: http://pugixml.googlecode.com/svn/trunk@411 99668b35-9821-0410-8761-19e4c4f06640 --- tests/test_parse_doctype.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'tests') diff --git a/tests/test_parse_doctype.cpp b/tests/test_parse_doctype.cpp index 92054ae..9cbd48c 100644 --- a/tests/test_parse_doctype.cpp +++ b/tests/test_parse_doctype.cpp @@ -19,6 +19,9 @@ bool test_doctype_wf(const std::basic_string& decl) if (!doc.load((decl + "").c_str()) || !test_node(doc, STR(""), STR(""), format_raw)) return false; if (!doc.load(("" + decl + "").c_str()) || !test_node(doc, STR(""), STR(""), format_raw)) return false; + // wrap in node to check that doctype is parsed fully (does not leave any "pcdata") + if (!doc.load(("" + decl + "").c_str()) || !test_node(doc, STR(""), STR(""), format_raw)) return false; + return true; } @@ -156,3 +159,58 @@ TEST(parse_doctype_xmlconf_eduni_5) TEST_DOCTYPE_WF(" ]>"); TEST_DOCTYPE_WF(" ]>"); } + +TEST(parse_doctype_xmlconf_ibm_1) +{ + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" %pe1; ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" \"> %pe3; ]>"); + TEST_DOCTYPE_WF(" '> %pe1; ]>"); +} + +TEST(parse_doctype_xmlconf_ibm_2) +{ + TEST_DOCTYPE_WF(" \"> ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_NWF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_NWF(" ]>"); + TEST_DOCTYPE_NWF(" ]>"); + TEST_DOCTYPE_NWF(" ]>"); + TEST_DOCTYPE_NWF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" &generalE; \"> %parameterE; ] animal>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_NWF(" \"> ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]>"); + TEST_DOCTYPE_WF(" ]]> ]>"); + TEST_DOCTYPE_WF(" ]]> ]>"); + TEST_DOCTYPE_NWF(" ]]> ]>"); + TEST_DOCTYPE_WF(" ]]> ]>"); + TEST_DOCTYPE_WF(" ]]> ]>"); + TEST_DOCTYPE_WF(" [INCLUDE ]]> ]>"); + TEST_DOCTYPE_NWF(" ]>"); + TEST_DOCTYPE_NWF(" ]>"); + TEST_DOCTYPE_WF(" %paaa; \"> ]>"); + TEST_DOCTYPE_WF(" \"> %paaa; ]>"); + TEST_DOCTYPE_NWF(" \" %paaa; ]>"); + TEST_DOCTYPE_WF(" ]>"); +} -- cgit v1.2.3