5 new tests (3 Parsoid serializer, 2 parser) & fixed 4 tests.
authorSubramanya Sastry <ssastry@wikimedia.org>
Tue, 2 Apr 2013 16:42:51 +0000 (11:42 -0500)
committerSubramanya Sastry <ssastry@wikimedia.org>
Thu, 11 Apr 2013 23:52:05 +0000 (18:52 -0500)
* Updated html output of two parsoid-centric tests to reflect
  changes in parsoid output.
* Updated 'disabled parsoid' options on two tests to 'parsoid'.
* Added three more tests for the Parsoid serializer.
* Added two tests documenting differences in PHP and Parsoid
  output for overlapping HTML tags (sometimes seen on wikipedia
  pages).

Change-Id: Id72fc5de5a09490028b64a522db3461970008960

tests/parser/parserTests.txt

index 0165cb2..809e3d6 100644 (file)
@@ -3530,7 +3530,6 @@ parsoid
 <table>
 <tbody>
 <tr>
-<td></td>
 <td>foo</td></tr></tbody></table>
 !! end
 
@@ -4246,7 +4245,7 @@ Horizontal ruler -- eats additional dashes on the same line
 !! end
 
 !! test
-Horizontal ruler -- does not collaps dashes on consecutive lines
+Horizontal ruler -- does not collapse dashes on consecutive lines
 !! input
 ----
 ----
@@ -11510,6 +11509,27 @@ bar
 </pre>
 !! end
 
+!!test
+Parsing of overlapping (improperly nested) inline html tags (PHP parser)
+!!options
+php
+!!input
+<span><s>x</span></s>
+!!result
+<p><span><s>x&lt;/span&gt;</s></span>
+</p>
+!!end
+
+!!test
+Parsing of overlapping (improperly nested) inline html tags (Parsoid)
+!!options
+parsoid
+!!input
+<span><s>x</span></s>
+!!result
+<p><span><s>x</s></span><s></s>
+</p>
+!!end
 
 ###
 ### Language variants related tests
@@ -14272,7 +14292,7 @@ RT-ed inter-element separators should be valid separators
 Trailing newlines in a deep dom-subtree that ends a wikitext line should be migrated out
 (Parsoid-only since PHP parser relies on Tidy for correct output)
 !!options
-disabled parsoid
+parsoid
 !!input
 {|
 |<small>foo
@@ -14304,11 +14324,30 @@ Empty TD followed by TD with tpl-generated attribute
 
 !!end
 
+!!test
+Indented table with an empty td
+!!input
+ {|
+ |-
+ |
+ |foo
+ |}
+!!result
+<table>
+
+<tr>
+<td>
+</td>
+<td>foo
+</td></tr></table>
+
+!!end
+
 !!test
 Empty TR followed by a template-generated TR
 (Parsoid-specific since PHP parser doesn't handle this mixed tbl-wikitext)
 !!options
-disabled parsoid
+parsoid
 !!input
 {|
 |-
@@ -14318,11 +14357,35 @@ disabled parsoid
 <table>
 <tbody>
 <tr>
-<td></td></tr>
+</tr>
 <tr>
 <td>foo</td></tr></tbody></table>
 !!end
 
+## PHP and parsoid output differ for this, and since this is primarily
+## for testing Parsoid's serializer, marking this Parsoid only
+!!test
+Empty TR followed by mixed-ws-comment line should RT correctly
+!!options
+parsoid
+!!input
+{|
+|-
+ <!--c-->
+|-
+<!--c--> <!--d-->
+|}
+!!result
+<table>
+<tbody>
+<tr>
+<td> <!--c--></td></tr>
+<tr>
+<td><!--c--> <!--d--></td></tr>
+</table>
+
+!!end
+
 !!test
 Multi-line image caption generated by templates with/without trailing newlines
 !!options
@@ -14336,6 +14399,21 @@ parsoid
 
 !!end
 
+## PHP emits broken html for this, and since this is primarily
+## a Parsoid serializer test, marking this Parsoid only
+!!test
+Improperly nested inline or quotes tags with whitespace in between
+!!options
+parsoid
+!!input
+<span> <s>x</span> </s>
+''' ''x''' ''
+!!result
+<p><span> <s>x</s></span><s> </s>
+<b> <i>x</i></b><i> </i></span>
+</p>
+!!end
+
 TODO:
 more images
 more tables