from std/data/xml/escape import *;
from test/more import *;
is(
escape_xml( "<tea attr=\"hot\">& 'biscuits'</tea>" ),
"<tea attr="hot">& 'biscuits'</tea>",
"escape_xml escapes XML-special characters",
);
is(
unescape_xml( "<tea>&"'</tea>" ),
"<tea>&\"'</tea>",
"unescape_xml decodes named XML entities",
);
is(
unescape_xml( "AA" ),
"AA",
"unescape_xml decodes decimal and hexadecimal numeric entities",
);
is(
unescape_xml( "&#65;" ),
"A",
"unescape_xml keeps escaped numeric entities as one level of unescape",
);
done_testing();