From 42543b07806ca9b9bec73eda91afa657f57c64bc Mon Sep 17 00:00:00 2001 From: Rupinder Singh Khokhar Date: Wed, 11 Jun 2014 09:13:22 +0530 Subject: Adding the latest test files without fixing the INDEXes or the test interfaces --- test/data/serializer/optionaltags.test | 965 +++++++++++++++++++++++++++++++++ 1 file changed, 965 insertions(+) create mode 100644 test/data/serializer/optionaltags.test (limited to 'test/data/serializer/optionaltags.test') diff --git a/test/data/serializer/optionaltags.test b/test/data/serializer/optionaltags.test new file mode 100644 index 0000000..80a5edf --- /dev/null +++ b/test/data/serializer/optionaltags.test @@ -0,0 +1,965 @@ +{"tests": [ + +{"description": "html start-tag followed by text, with attributes", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", [{"namespace": null, "name": "lang", "value": "en"}]], ["Characters", "foo"]], + "expected": ["foo"] +}, + + + +{"description": "html start-tag followed by comment", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "html start-tag followed by space character", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "html start-tag followed by text", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "html start-tag followed by start-tag", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "html start-tag followed by end-tag", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "html start-tag at EOF (shouldn't ever happen?!)", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "html", {}]], + "expected": [""] +}, + + + +{"description": "html end-tag followed by comment", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "html end-tag followed by space character", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "html end-tag followed by text", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "html end-tag followed by start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "html end-tag followed by end-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "html end-tag at EOF", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "html"]], + "expected": [""] +}, + + + + +{"description": "head start-tag followed by comment", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "head start-tag followed by space character", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "head start-tag followed by text", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "head start-tag followed by start-tag", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "head start-tag followed by end-tag (shouldn't ever happen?!)", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": ["", ""] +}, + +{"description": "empty head element", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "head"]], + "expected": [""] +}, + +{"description": "head start-tag followed by empty-tag", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}], ["EmptyTag", "foo", {}]], + "expected": [""] +}, + +{"description": "head start-tag at EOF (shouldn't ever happen?!)", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "head", {}]], + "expected": ["", ""] +}, + + + +{"description": "head end-tag followed by comment", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "head end-tag followed by space character", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "head end-tag followed by text", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "head end-tag followed by start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "head end-tag followed by end-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "head end-tag at EOF", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "head"]], + "expected": [""] +}, + + + + +{"description": "body start-tag followed by comment", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "body start-tag followed by space character", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "body start-tag followed by text", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "body start-tag followed by start-tag", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "body start-tag followed by end-tag", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "body start-tag at EOF (shouldn't ever happen?!)", + "input": [["StartTag", "http://www.w3.org/1999/xhtml", "body", {}]], + "expected": [""] +}, + + + +{"description": "body end-tag followed by comment", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "body end-tag followed by space character", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "body end-tag followed by text", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "body end-tag followed by start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "body end-tag followed by end-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "body end-tag at EOF", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "body"]], + "expected": [""] +}, + + + + +{"description": "li end-tag followed by comment", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "li end-tag followed by space character", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "li end-tag followed by text", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "li end-tag followed by start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "li end-tag followed by li start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["StartTag", "http://www.w3.org/1999/xhtml", "li", {}]], + "expected": ["
  • "] +}, + +{"description": "li end-tag followed by end-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "li end-tag at EOF", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "li"]], + "expected": [""] +}, + + + + +{"description": "dt end-tag followed by comment", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"], ["Comment", "foo"]], + "expected": [""] +}, + +{"description": "dt end-tag followed by space character", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "dt end-tag followed by text", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "dt end-tag followed by start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "dt end-tag followed by dt start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"], ["StartTag", "http://www.w3.org/1999/xhtml", "dt", {}]], + "expected": ["
    "] +}, + +{"description": "dt end-tag followed by dd start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"], ["StartTag", "http://www.w3.org/1999/xhtml", "dd", {}]], + "expected": ["
    "] +}, + +{"description": "dt end-tag followed by end-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "dt end-tag at EOF", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dt"]], + "expected": [""] +}, + + + + +{"description": "dd end-tag followed by comment", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"], ["Comment", "foo"]], + "expected": ["
    "] +}, + +{"description": "dd end-tag followed by space character", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"], ["Characters", " foo"]], + "expected": [" foo"] +}, + +{"description": "dd end-tag followed by text", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"], ["Characters", "foo"]], + "expected": ["foo"] +}, + +{"description": "dd end-tag followed by start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": [""] +}, + +{"description": "dd end-tag followed by dd start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"], ["StartTag", "http://www.w3.org/1999/xhtml", "dd", {}]], + "expected": ["
    "] +}, + +{"description": "dd end-tag followed by dt start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"], ["StartTag", "http://www.w3.org/1999/xhtml", "dt", {}]], + "expected": ["
    "] +}, + +{"description": "dd end-tag followed by end-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"], ["EndTag", "http://www.w3.org/1999/xhtml", "foo"]], + "expected": [""] +}, + +{"description": "dd end-tag at EOF", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "dd"]], + "expected": [""] +}, + + + + +{"description": "p end-tag followed by comment", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "p"], ["Comment", "foo"]], + "expected": ["

    "] +}, + +{"description": "p end-tag followed by space character", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "p"], ["Characters", " foo"]], + "expected": ["

    foo"] +}, + +{"description": "p end-tag followed by text", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "p"], ["Characters", "foo"]], + "expected": ["

    foo"] +}, + +{"description": "p end-tag followed by start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "p"], ["StartTag", "http://www.w3.org/1999/xhtml", "foo", {}]], + "expected": ["

    "] +}, + +{"description": "p end-tag followed by address start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "p"], ["StartTag", "http://www.w3.org/1999/xhtml", "address", {}]], + "expected": ["
    "] +}, + +{"description": "p end-tag followed by article start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "p"], ["StartTag", "http://www.w3.org/1999/xhtml", "article", {}]], + "expected": ["
    "] +}, + +{"description": "p end-tag followed by aside start-tag", + "input": [["EndTag", "http://www.w3.org/1999/xhtml", "p"], ["StartTag", "http://www.w3.org/1999/xhtml", "aside", {}]], + "expected": ["