/[suikacvs]/markup/html/whatpm/t/tokenizer/test2.test
Suika

Contents of /markup/html/whatpm/t/tokenizer/test2.test

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (hide annotations) (download)
Sat Aug 25 03:04:24 2007 UTC (17 years, 10 months ago) by wakaba
Branch: MAIN
Changes since 1.4: +5 -9 lines
++ whatpm/t/ChangeLog	25 Aug 2007 03:04:11 -0000
	* tokenizer-test-1.test: Two tests removed from |tokenizer/test2.test|
	are added.

	* tree-construction/, tokenizer/: Sync with latest html5lib.

2007-08-25  Wakaba  <wakaba@suika.fam.cx>

1 wakaba 1.1 {"tests": [
2    
3 wakaba 1.2 {"description":"DOCTYPE without name",
4 wakaba 1.1 "input":"<!DOCTYPE>",
5 wakaba 1.2 "output":["ParseError", "ParseError", ["DOCTYPE", "", null, null, false]]},
6 wakaba 1.1
7 wakaba 1.2 {"description":"DOCTYPE without space before name",
8 wakaba 1.1 "input":"<!DOCTYPEhtml>",
9 wakaba 1.2 "output":["ParseError", ["DOCTYPE", "html", null, null, true]]},
10 wakaba 1.1
11 wakaba 1.2 {"description":"Incorrect DOCTYPE without a space before name",
12 wakaba 1.1 "input":"<!DOCTYPEfoo>",
13 wakaba 1.2 "output":["ParseError", ["DOCTYPE", "foo", null, null, true]]},
14 wakaba 1.1
15 wakaba 1.2 {"description":"DOCTYPE with publicId",
16 wakaba 1.1 "input":"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML Transitional 4.01//EN\">",
17 wakaba 1.2 "output":[["DOCTYPE", "html", "-//W3C//DTD HTML Transitional 4.01//EN", null, true]]},
18    
19     {"description":"DOCTYPE with EOF after PUBLIC",
20     "input":"<!DOCTYPE html PUBLIC",
21     "output":["ParseError", ["DOCTYPE", "html", null, null, false]]},
22    
23     {"description":"DOCTYPE with EOF after PUBLIC '",
24     "input":"<!DOCTYPE html PUBLIC '",
25     "output":["ParseError", ["DOCTYPE", "html", "", null, false]]},
26    
27     {"description":"DOCTYPE with EOF after PUBLIC 'x",
28     "input":"<!DOCTYPE html PUBLIC 'x",
29     "output":["ParseError", ["DOCTYPE", "html", "x", null, false]]},
30    
31     {"description":"DOCTYPE with systemId",
32     "input":"<!DOCTYPE html SYSTEM \"-//W3C//DTD HTML Transitional 4.01//EN\">",
33     "output":[["DOCTYPE", "html", null, "-//W3C//DTD HTML Transitional 4.01//EN", true]]},
34    
35     {"description":"DOCTYPE with publicId and systemId",
36     "input":"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML Transitional 4.01//EN\" \"-//W3C//DTD HTML Transitional 4.01//EN\">",
37     "output":[["DOCTYPE", "html", "-//W3C//DTD HTML Transitional 4.01//EN", "-//W3C//DTD HTML Transitional 4.01//EN", true]]},
38 wakaba 1.1
39     {"description":"Incomplete doctype",
40     "input":"<!DOCTYPE html ",
41 wakaba 1.2 "output":["ParseError", ["DOCTYPE", "html", null, null, false]]},
42 wakaba 1.1
43     {"description":"Numeric entity representing the NUL character",
44     "input":"&#0000;",
45 wakaba 1.3 "output":["ParseError", ["Character", "\uFFFD"]]},
46 wakaba 1.1
47     {"description":"Hexadecimal entity representing the NUL character",
48     "input":"&#x0000;",
49 wakaba 1.3 "output":["ParseError", ["Character", "\uFFFD"]]},
50 wakaba 1.1
51     {"description":"Numeric entity representing a codepoint after 1114111 (U+10FFFF)",
52     "input":"&#2225222;",
53 wakaba 1.3 "output":["ParseError", ["Character", "\uFFFD"]]},
54 wakaba 1.1
55     {"description":"Hexadecimal entity representing a codepoint after 1114111 (U+10FFFF)",
56     "input":"&#x1010FFFF;",
57 wakaba 1.3 "output":["ParseError", ["Character", "\uFFFD"]]},
58    
59     {"description":"Hexadecimal entity pair representing a surrogate pair",
60     "input":"&#xD869;&#xDED6;",
61     "output":["ParseError", ["Character", "\uFFFD"], "ParseError", ["Character", "\uFFFD"]]},
62 wakaba 1.1
63     {"description":"Hexadecimal entity with mixed uppercase and lowercase",
64     "input":"&#xaBcD;",
65     "output":[["Character", "\uABCD"]]},
66    
67     {"description":"Entity without a name",
68     "input":"&;",
69     "output":["ParseError", ["Character", "&;"]]},
70    
71     {"description":"Unescaped ampersand in attribute value",
72     "input":"<h a='&'>",
73     "output":["ParseError", ["StartTag", "h", { "a":"&" }]]},
74    
75     {"description":"StartTag containing <",
76     "input":"<a<b>",
77 wakaba 1.2 "output":[["StartTag", "a<b", { }]]},
78 wakaba 1.1
79     {"description":"Non-void element containing trailing /",
80     "input":"<h/>",
81     "output":["ParseError", ["StartTag", "h", { }]]},
82    
83     {"description":"Void element with permitted slash",
84     "input":"<br/>",
85     "output":[["StartTag", "br", { }]]},
86    
87     {"description":"StartTag containing /",
88     "input":"<h/a='b'>",
89     "output":["ParseError", ["StartTag", "h", { "a":"b" }]]},
90    
91     {"description":"Double-quoted attribute value",
92     "input":"<h a=\"b\">",
93     "output":[["StartTag", "h", { "a":"b" }]]},
94    
95     {"description":"Unescaped </",
96     "input":"</",
97     "output":["ParseError", ["Character", "</"]]},
98    
99     {"description":"Illegal end tag name",
100     "input":"</1>",
101     "output":["ParseError", ["Comment", "1"]]},
102    
103     {"description":"Simili processing instruction",
104     "input":"<?namespace>",
105     "output":["ParseError", ["Comment", "?namespace"]]},
106    
107     {"description":"A bogus comment stops at >, even if preceeded by two dashes",
108     "input":"<?foo-->",
109     "output":["ParseError", ["Comment", "?foo--"]]},
110    
111     {"description":"Unescaped <",
112     "input":"foo < bar",
113     "output":[["Character", "foo "], "ParseError", ["Character", "< bar"]]},
114    
115     {"description":"Null Byte Replacement",
116     "input":"\u0000",
117 wakaba 1.4 "output":["ParseError", ["Character", "\ufffd"]]},
118    
119     {"description":"Comment with dash",
120     "input":"<!---x",
121 wakaba 1.5 "output":["ParseError", ["Comment", "-x"]]},
122    
123     {"description":"Entity + newline",
124     "input":"\nx\n&gt;\n",
125     "output":[["Character","\nx\n>\n"]]}
126 wakaba 1.1
127     ]}
128    
129    

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24