From 68d38421142b0cb1f6b62047c79d24f35f34174d Mon Sep 17 00:00:00 2001
From: Jason Woofenden
Date: Thu, 17 Dec 2015 11:12:32 -0500
Subject: [PATCH] add some aaa tests from html5lib-tests
---
parse-html.coffee | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/parse-html.coffee b/parse-html.coffee
index 08dd98f..6db8ab0 100644
--- a/parse-html.coffee
+++ b/parse-html.coffee
@@ -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: '
',
+ expected: 'tag:"a",{},[],tag:"p",{},[tag:"a",{},[]]',
+ errors: 2
+test_parser name: "html5lib aaa 2", \
+ html: '12
3',
+ expected: 'tag:"a",{},[text:"1"],tag:"p",{},[tag:"a",{},[text:"2"],text:"3"]',
+ errors: 2
+test_parser name: "html5lib aaa 3", \
+ html: '13',
+ expected: 'tag:"a",{},[text:"1"],tag:"button",{},[tag:"a",{},[text:"2"],text:"3"]',
+ errors: 2
+test_parser name: "html5lib aaa 4", \
+ html: '123',
+ expected: 'tag:"a",{},[text:"1",tag:"b",{},[text:"2"]],tag:"b",{},[text:"3"]',
+ errors: 2
+test_parser name: "html5lib aaa 5", \
+ html: '1',
+ expected: 'tag:"a",{},[text:"1"],tag:"div",{},[tag:"a",{},[text:"2"],tag:"div",{},[tag:"a",{},[text:"3"],text:"4"]text:"5"]',
+ errors: 3
--
1.7.10.4