jenkins-bot has submitted this change and it was merged.

Change subject: Sync parserTests with core version.
......................................................................


Sync parserTests with core version.

* We don't support page status indicator extension yet.
  All tests blacklisted.

Change-Id: I8e38c6c5aed4a90298757714e9d13da94cc3e564
---
M tests/fetch-parserTests.txt.js
M tests/parserTests-blacklist.js
M tests/parserTests.txt
3 files changed, 89 insertions(+), 4 deletions(-)

Approvals:
  Arlolra: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/fetch-parserTests.txt.js b/tests/fetch-parserTests.txt.js
index 8c3e868..e73b36b 100755
--- a/tests/fetch-parserTests.txt.js
+++ b/tests/fetch-parserTests.txt.js
@@ -12,9 +12,9 @@
 //     and update these hashes automatically.
 //
 // You can use 'sha1sum -b tests/parser/parserTests.txt' to compute this value:
-var expectedSHA1 = "f6d909cfbdbf19c5b2de360f26c59919b3f3be8f";
+var expectedSHA1 = "1dd1c769fc68d6ea7a8ae12aad04e657470223d3";
 // git log --pretty=oneline -1 tests/parser/parserTests.txt
-var latestCommit = "5205405385397782b5288b429f49c9d8c97ac6c6";
+var latestCommit = "278c83af8b2426d95f578e01e3bc679abf7b9d4b";
 
 var fs = require('fs'),
        path = require('path'),
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index 3a58913..ca767ef 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -374,6 +374,9 @@
 add("wt2html", "Verify that displaytitle works (bug #22501) 
AllowDisplayTitle=false no DISPLAYTITLE", "<p 
data-parsoid='{\"dsr\":[0,25,0,0]}'>this is not the the title</p>");
 add("wt2html", "Verify that displaytitle handles inline CSS styles (bug 26547) 
- rejected value", "<p data-parsoid='{\"dsr\":[0,25,0,0]}'>this is not the the 
title</p>\n<meta property=\"mw:PageProp/displaytitle\" content=\"screen\" 
data-parsoid='{\"src\":\"{{DISPLAYTITLE:&lt;span style=\\\"display: 
none;\\\">s&lt;/span>creen}}\",\"a\":{\"content\":\"screen\"},\"sa\":{\"content\":\"&lt;span
 style=\\\"display: 
none;\\\">s&lt;/span>creen\"},\"dsr\":[26,85,null,null]}'/>");
 add("wt2html", "Verify that displaytitle handles inline CSS styles (bug 26547) 
- accepted value", "<p data-parsoid='{\"dsr\":[0,25,0,0]}'>this is not the the 
title</p>\n<meta property=\"mw:PageProp/displaytitle\" content=\"screen\" 
data-parsoid='{\"src\":\"{{DISPLAYTITLE:&lt;span style=\\\"color: 
red;\\\">s&lt;/span>creen}}\",\"a\":{\"content\":\"screen\"},\"sa\":{\"content\":\"&lt;span
 style=\\\"color: red;\\\">s&lt;/span>creen\"},\"dsr\":[26,82,null,null]}'/>");
+add("wt2html", "Page status indicators: Empty name is invalid", "<p 
data-parsoid='{\"dsr\":[0,56,0,0]}'>&lt;indicator name=\" 
\">&lt;/indicator>\n&lt;indicator>&lt;/indicator></p>");
+add("wt2html", "Page status indicators: Weird syntaxes that are okay", "<p 
data-parsoid='{\"dsr\":[0,55,0,0]}'>&lt;indicator name=\"empty\" 
/>\n&lt;indicator name>&lt;/indicator></p>");
+add("wt2html", "Page status indicators: Torture test", "<p 
data-parsoid='{\"dsr\":[0,240,0,0]}'>&lt;indicator name=\"01\">hello 
world&lt;/indicator>\n&lt;indicator name=\"02\"><a rel=\"mw:WikiLink\" 
href=\"./Main_Page\" title=\"Main Page\" 
data-parsoid='{\"stx\":\"simple\",\"a\":{\"href\":\"./Main_Page\"},\"sa\":{\"href\":\"Main
 Page\"},\"dsr\":[66,79,2,2]}'>Main Page</a>&lt;/indicator>\n&lt;indicator 
name=\"03\"><span typeof=\"mw:Image\" 
data-parsoid='{\"optList\":[{\"ck\":\"width\",\"ak\":\"25px\"},{\"ck\":\"link\",\"ak\":\"link=\"}],\"dsr\":[113,143,null,null]}'><span
 data-parsoid=\"{}\"><img resource=\"./File:Foobar.jpg\" 
src=\"//example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg\" 
data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" 
height=\"3\" width=\"25\" 
data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"3\",\"width\":\"25\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></span></span>&lt;/indicator>\n&lt;indicator
 name=\"04\"><span typeof=\"mw:Image\" 
data-parsoid='{\"optList\":[{\"ck\":\"width\",\"ak\":\"25px\"}],\"dsr\":[177,201,null,null]}'><a
 href=\"./File:Foobar.jpg\" 
data-parsoid='{\"a\":{\"href\":\"./File:Foobar.jpg\"},\"sa\":{}}'><img 
resource=\"./File:Foobar.jpg\" 
src=\"//example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg\" 
data-file-width=\"1941\" data-file-height=\"220\" data-file-type=\"bitmap\" 
height=\"3\" width=\"25\" 
data-parsoid='{\"a\":{\"resource\":\"./File:Foobar.jpg\",\"height\":\"3\",\"width\":\"25\"},\"sa\":{\"resource\":\"File:Foobar.jpg\"}}'/></a></span>&lt;/indicator>\n&lt;indicator
 name=\"05\">* foo</p>\n<ul data-parsoid='{\"dsr\":[241,258,0,0]}'><li 
data-parsoid='{\"dsr\":[241,258,1,0]}'> bar&lt;/indicator></li></ul>\n<p 
data-parsoid='{\"dsr\":[259,359,0,0]}'>&lt;indicator name=\"06\"><span 
typeof=\"mw:Nowiki\" 
data-parsoid='{\"dsr\":[280,300,8,9]}'>foo</span>&lt;/indicator>\n&lt;indicator 
name=\"07\"> Preformatted&lt;/indicator></p>\n<p 
data-parsoid='{\"dsr\":[360,381,0,0]}'>&lt;indicator name=\"08\"></p><div 
data-parsoid='{\"stx\":\"html\",\"autoInsertedEnd\":true,\"dsr\":[381,519,5,0]}'>Broken
 tag&lt;/indicator>\n<p data-parsoid='{\"dsr\":[409,495,0,0]}'>&lt;indicator 
name=\"09\">{| class=wikitable\n| cell\n|}&lt;/indicator>\n&lt;indicator 
name=\"10\">Two</p>\n\n<p 
data-parsoid='{\"dsr\":[497,519,0,0]}'>paragraphs&lt;/indicator></p></div>");
 add("wt2html", "preload: check <noinclude> and <includeonly>", "<p 
data-parsoid='{\"dsr\":[0,72,0,0]}'>Hello <meta 
typeof=\"mw:Includes/NoInclude\" 
data-parsoid='{\"src\":\"&lt;noinclude>\",\"dsr\":[6,17,null,null]}'/>cruel<meta
 typeof=\"mw:Includes/NoInclude/End\" 
data-parsoid='{\"src\":\"&lt;/noinclude>\",\"dsr\":[22,34,null,null]}'/><meta 
typeof=\"mw:Includes/IncludeOnly\" 
data-parsoid='{\"src\":\"&lt;includeonly>kind&lt;/includeonly>\",\"dsr\":[34,65,null,null]}'/><meta
 typeof=\"mw:Includes/IncludeOnly/End\" 
data-parsoid='{\"src\":\"\",\"dsr\":[65,65,null,null]}'/> world.</p>");
 add("wt2html", "preload: check <onlyinclude>", "<p 
data-parsoid='{\"dsr\":[0,32,0,0]}'>Goodbye <meta 
typeof=\"mw:Includes/OnlyInclude\" 
data-parsoid='{\"src\":\"&lt;onlyinclude>\",\"dsr\":[8,21,null,null]}'/>Hello 
world</p><meta typeof=\"mw:Includes/OnlyInclude/End\" 
data-parsoid='{\"src\":\"&lt;/onlyinclude>\",\"dsr\":[32,46,null,null]}'/>");
 add("wt2html", "preload: can pass tags through if we want to", "<meta 
typeof=\"mw:Includes/IncludeOnly\" 
data-parsoid='{\"src\":\"&lt;includeonly>&lt;&lt;/includeonly>\",\"dsr\":[0,28,null,null]}'/><meta
 typeof=\"mw:Includes/IncludeOnly/End\" 
data-parsoid='{\"src\":\"\",\"dsr\":[28,28,null,null]}'/><p 
data-parsoid='{\"dsr\":[28,92,0,0]}'>includeonly>Hello world<meta 
typeof=\"mw:Includes/IncludeOnly\" 
data-parsoid='{\"src\":\"&lt;includeonly>&lt;&lt;/includeonly>\",\"dsr\":[51,79,null,null]}'/><meta
 typeof=\"mw:Includes/IncludeOnly/End\" 
data-parsoid='{\"src\":\"\",\"dsr\":[79,79,null,null]}'/>/includeonly></p>");
@@ -845,6 +848,8 @@
 add("html2html", "Verify that displaytitle works (bug #22501) 
AllowDisplayTitle=false no DISPLAYTITLE", "<p 
data-parsoid='{\"dsr\":[0,6,0,0]}'>Screen</p>\n\n<p 
data-parsoid='{\"dsr\":[8,33,0,0]}'>this is not the the title</p>\n");
 add("html2html", "Verify that displaytitle handles inline CSS styles (bug 
26547) - rejected value", "<p data-parsoid='{\"dsr\":[0,75,0,0]}'><span 
style=\" \" data-parsoid='{\"stx\":\"html\",\"a\":{\"style\":\" 
\"},\"sa\":{\"style\":\"/* attempt to bypass $wgRestrictDisplayTitle 
*/\"},\"dsr\":[0,70,62,7]}'>s</span>creen</p>\n\n<p 
data-parsoid='{\"dsr\":[77,102,0,0]}'>this is not the the title</p>\n");
 add("html2html", "Verify that displaytitle handles inline CSS styles (bug 
26547) - accepted value", "<p data-parsoid='{\"dsr\":[0,39,0,0]}'><span 
style=\"color: red;\" 
data-parsoid='{\"stx\":\"html\",\"dsr\":[0,34,26,7]}'>s</span>creen</p>\n\n<p 
data-parsoid='{\"dsr\":[41,66,0,0]}'>this is not the the title</p>\n");
+add("html2html", "Page status indicators: Weird syntaxes that are okay", "<p 
data-parsoid='{\"dsr\":[0,12,0,0]}'>empty=\nname=</p>\n\n<p 
data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[14,14,0,0]}'><br 
data-parsoid='{\"dsr\":[14,14,0,0]}'/></p>\n");
+add("html2html", "Page status indicators: Torture test", "<p 
data-parsoid='{\"dsr\":[0,184,0,0]}'>01=hello world\n02=<a rel=\"mw:WikiLink\" 
href=\"./Wiki/Main_Page\" title=\"Wiki/Main Page\" 
data-parsoid='{\"stx\":\"piped\",\"a\":{\"href\":\"./Wiki/Main_Page\"},\"sa\":{\"href\":\"wiki/Main
 Page\"},\"dsr\":[18,46,17,2]}'>Main Page</a>\n03=<img 
src=\"http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg\"; 
alt=\"25px-Foobar.jpg\" rel=\"mw:externalImage\" 
data-parsoid='{\"dsr\":[50,113,null,null]}'/>\n04=<img 
src=\"http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg\"; 
alt=\"25px-Foobar.jpg\" rel=\"mw:externalImage\" 
data-parsoid='{\"dsr\":[117,180,null,null]}'/>\n05=</p>\n<ul 
data-parsoid='{\"dsr\":[185,196,0,0]}'><li 
data-parsoid='{\"dsr\":[185,190,1,0]}'> foo</li>\n<li 
data-parsoid='{\"dsr\":[191,196,1,0]}'> bar</li></ul>\n\n<p 
data-parsoid='{\"dsr\":[198,208,0,0]}'>06=foo\n07=</p>\n<pre 
data-parsoid='{\"dsr\":[209,222,1,0]}'>Preformatted</pre>\n\n<p 
data-parsoid='{\"dsr\":[224,227,0,0]}'>08=</p><div 
data-parsoid='{\"stx\":\"html\",\"dsr\":[227,248,5,6]}'>Broken tag</div>\n\n<p 
data-parsoid='{\"dsr\":[250,253,0,0]}'>09=</p>\n<table class=\"wikitable\" 
data-parsoid='{\"dsr\":[254,285,20,2]}'>\n\n<tbody 
data-parsoid='{\"dsr\":[276,283,0,0]}'><tr 
data-parsoid='{\"autoInsertedEnd\":true,\"autoInsertedStart\":true,\"dsr\":[276,282,0,0]}'><td
 data-parsoid='{\"autoInsertedEnd\":true,\"dsr\":[276,282,1,0]}'> 
cell</td></tr>\n</tbody></table>\n\n<p 
data-parsoid='{\"dsr\":[287,290,0,0]}'>10=</p>\n\n<p 
data-parsoid='{\"dsr\":[292,295,0,0]}'>Two</p>\n\n<p 
data-parsoid='{\"dsr\":[297,307,0,0]}'>paragraphs</p>\n\n<p 
data-parsoid='{\"dsr\":[309,309,0,0]}'><br 
data-parsoid='{\"dsr\":[309,309,0,0]}'/></p>\n\n\n<p 
data-parsoid='{\"dsr\":[312,312,0,0]}'><br 
data-parsoid='{\"dsr\":[312,312,0,0]}'/></p>\n\n\n<p 
data-parsoid='{\"dsr\":[315,315,0,0]}'><br 
data-parsoid='{\"dsr\":[315,315,0,0]}'/></p>\n\n\n");
 add("html2html", "preload: check <noinclude> and <includeonly>", "<p 
data-parsoid='{\"dsr\":[0,17,0,0]}'>Hello kind world.</p>");
 add("html2html", "preload: check <onlyinclude>", "<p 
data-parsoid='{\"dsr\":[0,11,0,0]}'>Hello world</p>");
 add("html2html", "preload: can pass tags through if we want to", "<meta 
typeof=\"mw:Includes/IncludeOnly\" 
data-parsoid='{\"src\":\"&lt;includeonly>Hello 
world&lt;/includeonly>\",\"dsr\":[0,38,null,null]}'/><meta 
typeof=\"mw:Includes/IncludeOnly/End\" 
data-parsoid='{\"src\":\"\",\"dsr\":[38,38,null,null]}'/>");
@@ -1656,6 +1661,9 @@
 add("html2wt", "Verify that displaytitle works (bug #22501) 
AllowDisplayTitle=false no DISPLAYTITLE", "Screen\n\nthis is not the the 
title\n");
 add("html2wt", "Verify that displaytitle handles inline CSS styles (bug 26547) 
- rejected value", "<span style=\"/* attempt to bypass $wgRestrictDisplayTitle 
*/\">s</span>creen\n\nthis is not the the title\n");
 add("html2wt", "Verify that displaytitle handles inline CSS styles (bug 26547) 
- accepted value", "<span style=\"color: red;\">s</span>creen\n\nthis is not 
the the title\n");
+add("html2wt", "Page status indicators: Empty name is invalid", "<span 
class=\"error\"><strong>Error:</strong> Page status indicators' 
<code>name</code> attribute must not be empty.</span>\n<span 
class=\"error\"><strong>Error:</strong> Page status indicators' 
<code>name</code> attribute must not be empty.</span>\n");
+add("html2wt", "Page status indicators: Weird syntaxes that are okay", 
"empty=\nname=\n\n\n");
+add("html2wt", "Page status indicators: Torture test", "01=hello 
world\n02=[[wiki/Main Page|Main 
Page]]\n03=http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg\n04=http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg\n05=\n*
 foo\n* bar\n\n06=foo\n07=\n Preformatted\n\n08=<div>Broken 
tag</div>\n\n09=\n{| class=\"wikitable\"\n\n| 
cell\n|}\n\n10=\n\nTwo\n\nparagraphs\n\n\n\n\n\n\n\n\n\n\n");
 add("html2wt", "preload: check <noinclude> and <includeonly>", "Hello kind 
world.");
 add("html2wt", "preload: check <onlyinclude>", "Hello world");
 add("html2wt", "preload: can pass tags through if we want to", 
"<includeonly>Hello world</includeonly>");
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 473d935..e965352 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -26,6 +26,7 @@
 # php           php-only test (not run by the parsoid parser unless
 #                 the test includes an html/parsoid section)
 # showtitle     make the first line the title
+# showindicators make the first lines the page status indicators
 # comment       run through Linker::formatComment() instead of main parser
 # local         format section links in edit comment text as local links
 # notoc         disable table of contents
@@ -13961,7 +13962,7 @@
 </ul>
 </div>
 
-<h2><span class="mw-headline" id="text_.3E_text">text &gt; text</span><span 
class="mw-editsection"><span class="mw-editsection-bracket">[</span><a 
href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit 
section: text > text">edit</a><span 
class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="text_.3E_text">text &gt; text</span><span 
class="mw-editsection"><span class="mw-editsection-bracket">[</span><a 
href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit 
section: text &gt; text">edit</a><span 
class="mw-editsection-bracket">]</span></span></h2>
 <p>section 1
 </p>
 <h2><span class="mw-headline" id="text_.3C_text">text &lt; text</span><span 
class="mw-editsection"><span class="mw-editsection-bracket">[</span><a 
href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit 
section: text &lt; text">edit</a><span 
class="mw-editsection-bracket">]</span></span></h2>
@@ -19205,6 +19206,82 @@
 !! end
 
 !! test
+Page status indicators: Empty name is invalid
+!! options
+showindicators
+!! wikitext
+<indicator name=" "></indicator>
+<indicator></indicator>
+!! html
+<p><span class="error"><strong>Error:</strong> Page status indicators' 
<code>name</code> attribute must not be empty.</span>
+<span class="error"><strong>Error:</strong> Page status indicators' 
<code>name</code> attribute must not be empty.</span>
+</p>
+!! end
+
+!! test
+Page status indicators: Weird syntaxes that are okay
+!! options
+showindicators
+!! wikitext
+<indicator name="empty" />
+<indicator name></indicator>
+!! html
+empty=
+name=
+<p><br />
+</p>
+!! end
+
+!! test
+Page status indicators: Torture test
+!! options
+showindicators
+!! wikitext
+<indicator name="01">hello world</indicator>
+<indicator name="02">[[Main Page]]</indicator>
+<indicator name="03">[[File:Foobar.jpg|25px|link=]]</indicator>
+<indicator name="04">[[File:Foobar.jpg|25px]]</indicator>
+<indicator name="05">* foo
+* bar</indicator>
+<indicator name="06"><nowiki>foo</nowiki></indicator>
+<indicator name="07"> Preformatted</indicator>
+<indicator name="08"><div>Broken tag</indicator>
+<indicator name="09">{| class=wikitable
+| cell
+|}</indicator>
+<indicator name="10">Two
+
+paragraphs</indicator>
+!! html
+01=hello world
+02=<a href="/wiki/Main_Page" title="Main Page">Main Page</a>
+03=<img alt="Foobar.jpg" 
src="http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg"; 
width="25" height="3" 
srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/38px-Foobar.jpg 1.5x, 
http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg 2x" />
+04=<a href="/wiki/File:Foobar.jpg" class="image"><img alt="Foobar.jpg" 
src="http://example.com/images/thumb/3/3a/Foobar.jpg/25px-Foobar.jpg"; 
width="25" height="3" 
srcset="http://example.com/images/thumb/3/3a/Foobar.jpg/38px-Foobar.jpg 1.5x, 
http://example.com/images/thumb/3/3a/Foobar.jpg/50px-Foobar.jpg 2x" /></a>
+05=<ul><li> foo</li>
+<li> bar</li></ul>
+
+06=foo
+07=<pre>Preformatted
+</pre>
+08=<div>Broken tag</div>
+
+09=<table class="wikitable">
+<tr>
+<td> cell
+</td></tr></table>
+
+10=<p>Two
+</p><p>paragraphs
+</p>
+<p><br />
+</p><p><br />
+</p><p><br />
+</p><p><br />
+</p><p><br />
+</p>
+!! end
+
+!! test
 preload: check <noinclude> and <includeonly>
 !! options
 preload
@@ -19592,7 +19669,7 @@
 </div>
 
 <h2><span class="mw-headline" id="Hello"><sup 
class="in-h2">Hello</sup></span><span class="mw-editsection"><span 
class="mw-editsection-bracket">[</span><a 
href="/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit 
section: Hello">edit</a><span 
class="mw-editsection-bracket">]</span></span></h2>
-<h2><span class="mw-headline" id="b.22.3EEvilbye"><sup> 
b"&gt;Evilbye</sup></span><span class="mw-editsection"><span 
class="mw-editsection-bracket">[</span><a 
href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit 
section: b&quot;>Evilbye">edit</a><span 
class="mw-editsection-bracket">]</span></span></h2>
+<h2><span class="mw-headline" id="b.22.3EEvilbye"><sup> 
b"&gt;Evilbye</sup></span><span class="mw-editsection"><span 
class="mw-editsection-bracket">[</span><a 
href="/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit 
section: b&quot;&gt;Evilbye">edit</a><span 
class="mw-editsection-bracket">]</span></span></h2>
 
 !! end
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e38c6c5aed4a90298757714e9d13da94cc3e564
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Cscott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to