JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
add some aaa tests from html5lib-tests
authorJason Woofenden <jason@jasonwoof.com>
Thu, 17 Dec 2015 16:12:32 +0000 (11:12 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 17 Dec 2015 16:12:32 +0000 (11:12 -0500)
parse-html.coffee

index 08dd98f..6db8ab0 100644 (file)
@@ -1203,3 +1203,24 @@ test_parser name: "crazy formatting elements test", \
        # firefox does this:
        expected: 'tag:"b",{},[tag:"i",{},[tag:"a",{},[tag:"s",{},[tag:"tt",{},[]]]]],tag:"a",{},[tag:"s",{},[tag:"tt",{},[tag:"div",{},[tag:"b",{},[],text:"first"]]]],text:"second"',
        errors: 6 # no idea how many there should be
+# tests from https://github.com/html5lib/html5lib-tests/blob/master/tree-construction/adoption01.dat
+test_parser name: "html5lib aaa 1", \
+       html: '<a><p></a></p>',
+       expected: 'tag:"a",{},[],tag:"p",{},[tag:"a",{},[]]',
+       errors: 2
+test_parser name: "html5lib aaa 2", \
+       html: '<a>1<p>2</a>3</p>',
+       expected: 'tag:"a",{},[text:"1"],tag:"p",{},[tag:"a",{},[text:"2"],text:"3"]',
+       errors: 2
+test_parser name: "html5lib aaa 3", \
+       html: '<a>1<button>2</a>3</button>',
+       expected: 'tag:"a",{},[text:"1"],tag:"button",{},[tag:"a",{},[text:"2"],text:"3"]',
+       errors: 2
+test_parser name: "html5lib aaa 4", \
+       html: '<a>1<b>2</a>3</b>',
+       expected: 'tag:"a",{},[text:"1",tag:"b",{},[text:"2"]],tag:"b",{},[text:"3"]',
+       errors: 2
+test_parser name: "html5lib aaa 5", \
+       html: '<a>1<div>2<div>3</a>4</div>5</div>',
+       expected: 'tag:"a",{},[text:"1"],tag:"div",{},[tag:"a",{},[text:"2"],tag:"div",{},[tag:"a",{},[text:"3"],text:"4"]text:"5"]',
+       errors: 3