/[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.1 - (hide annotations) (download)
Sat Jun 23 02:09:06 2007 UTC (18 years, 1 month ago) by wakaba
Branch: MAIN
Tests from html5lib are now part of Whatpm CVS repository

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24