Subramanya Sastry has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/56620


Change subject: Several Parsoid-specific tests for serializer edge cases.
......................................................................

Several Parsoid-specific tests for serializer edge cases.

* For catching future serializer regressions.
* For fixing existing incorrect serialization.

Change-Id: Ifbb7da59f65e790b66a621b7964179e4eb1f3fc4
---
M tests/parser/parserTests.txt
1 file changed, 96 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/20/56620/1

diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index d3bd6a5..af9eea3 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -6007,6 +6007,15 @@
 !!end
 
 !!test
+Templates: HTML Tag: 7. Generation of partial attribute key string
+!!input
+<div st{{echo|yle}}="color:red;">foo</div>
+!!result
+<div style="color:red;">foo</div>
+
+!!end
+
+!!test
 Templates: HTML Tables: 1. Generating start of a HTML table
 !!input
 {{echo|<table><tr><td>foo</td>}}</tr></table>
@@ -14203,6 +14212,93 @@
 
 !! end
 
+###
+### Parsoid-centric tests for testing RTing of inter-element separators
+### Edge cases not tested by existing parser tests and specific to
+### Parsoid-specific serialization strategies.
+###
+
+!!test
+RT-ed inter-element separators should be valid separators
+!!input
+{|
+|- [[foo]]
+|}
+!!result
+<table>
+
+</table>
+
+!!end
+
+!!test
+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
+!!input
+{|
+|<small>foo
+bar
+|}
+
+{|
+|<small>foo<small>
+|}
+!!result
+!!end
+
+!!test
+Empty TD followed by TD with tpl-generated attribute
+!!input
+{|
+|-
+|
+|{{echo|style='color:red'}}|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
+!!input
+{|
+|-
+{{echo|<tr><td>foo</td></tr>}}
+|}
+!!result
+<table>
+<tbody>
+<tr>
+<td></td></tr>
+<tr>
+<td>foo</td></tr></tbody></table>
+!!end
+
+!!test
+Multi-line image caption generated by templates with/without trailing newlines
+!!options
+parsoid
+!!input
+[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}]]
+[[File:foo.jpg|thumb|300px|foo\n{{echo|A}}\n{{echo|B}}\n{{echo|C}}\n\n]]
+!!result
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a 
href="/index.php?title=Special:Upload&amp;wpDestFile=Foo.jpg" class="new" 
title="File:Foo.jpg">File:Foo.jpg</a>  <div 
class="thumbcaption">foo\nA\nB\nC</div></div></div>
+<div class="thumb tright"><div class="thumbinner" style="width:182px;"><a 
href="/index.php?title=Special:Upload&amp;wpDestFile=Foo.jpg" class="new" 
title="File:Foo.jpg">File:Foo.jpg</a>  <div 
class="thumbcaption">foo\nA\nB\nC\n\n</div></div></div>
+
+!!end
+
 TODO:
 more images
 more tables

-- 
To view, visit https://gerrit.wikimedia.org/r/56620
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifbb7da59f65e790b66a621b7964179e4eb1f3fc4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <ssas...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to