From 7b30a5520cfb56e651f0eb4da85a3e07747da7dc Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sat, 23 Jun 2007 22:40:25 +0000 Subject: Import hubbub -- an HTML parsing library. Plenty of work still to do (like tree generation ;) svn path=/trunk/hubbub/; revision=3359 --- test/data/tokeniser2/test2.test | 108 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 test/data/tokeniser2/test2.test (limited to 'test/data/tokeniser2/test2.test') diff --git a/test/data/tokeniser2/test2.test b/test/data/tokeniser2/test2.test new file mode 100644 index 0000000..32c0f99 --- /dev/null +++ b/test/data/tokeniser2/test2.test @@ -0,0 +1,108 @@ +{"tests": [ + +{"description":"Doctype without a name", +"input":"", +"output":["ParseError", "ParseError", ["DOCTYPE", "", true]]}, + +{"description":"Correct doctype without a space before name", +"input":"", +"output":["ParseError", ["DOCTYPE", "HTML", false]]}, + +{"description":"Incorrect doctype without a space before name", +"input":"", +"output":["ParseError", ["DOCTYPE", "FOO", true]]}, + +{"description":"Bogus doctype", +"input":"", +"output":["ParseError", ["DOCTYPE", "HTML", true]]}, + +{"description":"Incomplete doctype", +"input":"", +"output":["ParseError", ["StartTag", "h", { "a":"&" }]]}, + +{"description":"StartTag containing <", +"input":"", +"output":["ParseError", ["StartTag", "a", { }], ["StartTag", "b", { }]]}, + +{"description":"Non-void element containing trailing /", +"input":"", +"output":["ParseError", ["StartTag", "h", { }]]}, + +{"description":"Void element with permitted slash", +"input":"
", +"output":[["StartTag", "br", { }]]}, + +{"description":"StartTag containing /", +"input":"", +"output":["ParseError", ["StartTag", "h", { "a":"b" }]]}, + +{"description":"Double-quoted attribute value", +"input":"", +"output":[["StartTag", "h", { "a":"b" }]]}, + +{"description":"Unescaped ", +"output":["ParseError", ["Comment", "1"]]}, + +{"description":"Simili processing instruction", +"input":"", +"output":["ParseError", ["Comment", "?namespace"]]}, + +{"description":"A bogus comment stops at >, even if preceeded by two dashes", +"input":"", +"output":["ParseError", ["Comment", "?foo--"]]}, + +{"description":"Unescaped <", +"input":"foo < bar", +"output":[["Character", "foo "], "ParseError", ["Character", "< bar"]]}, + +/* jmb -- libjson uses C strings internally, thus the input gets truncated before the + * data is fed to the input stream (and thus the tokeniser) +{"description":"Null Byte Replacement", +"input":"\u0000", +"output":[["Character", "\ufffd"]]} +*/ + +]} + + -- cgit v1.2.3