tests: Add a test

This commit is contained in:
Lord-McSweeney 2024-01-03 14:03:17 +03:00 committed by TÖRÖK Attila
parent a7716bb744
commit 0a6a95e6f1
4 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,48 @@
package {
import flash.display.MovieClip;
public class Test extends MovieClip {
public function Test() {
XML.prettyPrinting = false;
var tests = [
"<![CDATA[abcd]]>text",
"<!-- comment --><elem><?pi PI?><!-- inner --> innerText </elem><?pi PI?><![CDATA[ ]]>",
" <![CDATA[abcd]]><body/>",
"<body/><?pi PI?><body2/><!-- comment -->",
"<elem><?pi innerPI?></elem><?pi PI?>",
" <body/> ",
"<?pi PI?><!-- comment -->"
];
var settingss = [
[false, false, false],
[false, false, true],
[false, true, false],
[false, true, true],
[true, false, false],
[true, false, true],
[true, true, false],
[true, true, true]
];
for(var i in tests) {
var test = tests[i];
for(var j in settingss) {
var settings = settingss[j];
XML.ignoreComments = settings[0];
XML.ignoreProcessingInstructions = settings[1];
XML.ignoreWhitespace = settings[2];
try
{
var x:XML = new XML(test);
trace(x.toXMLString());
}
catch(e:Error)
{
trace("err: " + e);
}
}
}
}
}
}

View File

@ -0,0 +1,56 @@
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
<elem><?pi PI?><!-- inner --> innerText </elem>
<elem><?pi PI?><!-- inner -->innerText</elem>
<elem><!-- inner --> innerText </elem>
<elem><!-- inner -->innerText</elem>
<elem><?pi PI?> innerText </elem>
<elem><?pi PI?>innerText</elem>
<elem> innerText </elem>
<elem>innerText</elem>
<body/>
<body/>
<body/>
<body/>
<body/>
<body/>
<body/>
<body/>
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
<elem><?pi innerPI?></elem>
<elem><?pi innerPI?></elem>
<elem/>
<elem/>
<elem><?pi innerPI?></elem>
<elem><?pi innerPI?></elem>
<elem/>
<elem/>
<body/>
<body/>
<body/>
<body/>
<body/>
<body/>
<body/>
<body/>
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
err: TypeError: Error #1088: The markup in the document following the root element must be well-formed.
<!-- comment -->
<!-- comment -->
<?pi PI?>
<?pi PI?>

Binary file not shown.

View File

@ -0,0 +1 @@
num_frames = 1