Skip to content

Commit eec5e90

Browse files
evilpietorokati44
authored andcommitted
tests: Test mismatched E4X tags
1 parent 8768143 commit eec5e90

File tree

6 files changed

+77
-2
lines changed

6 files changed

+77
-2
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package {
2+
import flash.display.Sprite;
3+
public class Test extends Sprite { }
4+
}
5+
6+
var testcases = [
7+
"<a>",
8+
"<a><b>",
9+
"<a></a>",
10+
"<a></a/>",
11+
// TODO: Should be rejected
12+
// "<a></a//>",
13+
"<a></a />",
14+
"<a></a >",
15+
"<a></a\t>",
16+
'<a></a hello="world">',
17+
"<a></b>",
18+
"<a></b/>",
19+
"<a></b//>",
20+
"<a></b >",
21+
"<a></b\t>",
22+
'<a></b hello="world">',
23+
"<a></A>",
24+
"<a></abc>",
25+
// TODO
26+
// "<a></a bc>",
27+
"<root><a></a/><test/></root>",
28+
]
29+
30+
for each (var testcase in testcases) {
31+
trace("input: " + testcase);
32+
33+
try {
34+
var xml = new XML(testcase);
35+
trace("result: " + xml.toXMLString());
36+
} catch (e) {
37+
trace(e);
38+
}
39+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
input: <a>
2+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
3+
input: <a><b>
4+
TypeError: Error #1085: The element type "b" must be terminated by the matching end-tag "</b>".
5+
input: <a></a>
6+
result: <a/>
7+
input: <a></a/>
8+
result: <a/>
9+
input: <a></a />
10+
result: <a/>
11+
input: <a></a >
12+
result: <a/>
13+
input: <a></a >
14+
result: <a/>
15+
input: <a></a hello="world">
16+
result: <a/>
17+
input: <a></b>
18+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
19+
input: <a></b/>
20+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
21+
input: <a></b//>
22+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
23+
input: <a></b >
24+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
25+
input: <a></b >
26+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
27+
input: <a></b hello="world">
28+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
29+
input: <a></A>
30+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
31+
input: <a></abc>
32+
TypeError: Error #1085: The element type "a" must be terminated by the matching end-tag "</a>".
33+
input: <root><a></a/><test/></root>
34+
result: <root>
35+
<a/>
36+
<test/>
37+
</root>
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
num_ticks = 1
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
num_ticks = 1
2-
known_failure = true
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
num_ticks = 1
2-
known_failure = true

0 commit comments

Comments
 (0)