Additional tests to keep Parsoid in line (regressions + accuracy)
authorSubramanya Sastry <ssastry@wikimedia.org>
Wed, 21 Nov 2012 21:33:17 +0000 (15:33 -0600)
committerSubramanya Sastry <ssastry@wikimedia.org>
Wed, 21 Nov 2012 21:33:17 +0000 (15:33 -0600)
* Added a td-cell wikitext syntax variant to spec PHP parser
  behavior.
* Added an image parsing test to prevent rt regressions.

Change-Id: I414d0f7368f520df4e02f310d6c82037d3c96d45

tests/parser/parserTests.txt

index 305d0f1..03a184b 100644 (file)
@@ -2578,6 +2578,31 @@ A table with nothing but a caption
 
 !! end
 
+!! test
+Table td-cell syntax variations
+!! input
+{|
+| foo bar foo | baz
+| foo bar foo || baz
+| style='color:red;' | baz
+| style='color:red;' || baz
+|}
+!! result
+<table>
+<tr>
+<td> baz
+</td>
+<td> foo bar foo </td>
+<td> baz
+</td>
+<td style="color:red;"> baz
+</td>
+<td> style='color:red;' </td>
+<td> baz
+</td></tr></table>
+
+!! end
+
 !! test
 Simple table
 !! input
@@ -6093,6 +6118,19 @@ Image with multiple captions -- only last one is accepted
 
 !! end
 
+!! test
+Image with width attribute at different positions
+!! input
+[[Image:foobar.jpg|200px|right|Caption]]
+[[Image:foobar.jpg|right|200px|Caption]]
+[[Image:foobar.jpg|right|Caption|200px]]
+!! result
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+<div class="floatright"><a href="/wiki/File:Foobar.jpg" class="image" title="Caption"><img alt="Caption" src="http://example.com/images/thumb/3/3a/Foobar.jpg/200px-Foobar.jpg" width="200" height="23" srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/300px-Foobar.jpg 1.5x, http://example.com/images/thumb/3/3a/Foobar.jpg/400px-Foobar.jpg 2x" /></a></div>
+
+!! end
+
 !! test
 Image with link parameter, wiki target
 !! input