r86795 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86794‎ | r86795 | r86796 >
Date:21:26, 23 April 2011
Author:mah
Status:ok
Tags:
Comment:
* Add preprocessor tests that Bergi supplied for Bug #28642
* Add Bergi to CREDITS
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/tests/parser/preprocess/Headings.expected (added) (history)
  • /trunk/phase3/tests/parser/preprocess/Headings.txt (added) (history)
  • /trunk/phase3/tests/phpunit/includes/parser/PreprocessorTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -10,6 +10,7 @@
1111 * Aryeh Gregor
1212 * Ashar Voultoiz
1313 * Bertrand Grondin
 14+* Bergi
1415 * Brion Vibber
1516 * Bryan Tong Minh
1617 * Chad Horohoe
Index: trunk/phase3/tests/phpunit/includes/parser/PreprocessorTest.php
@@ -116,6 +116,7 @@
117117 array( "Factorial" ), # http://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC-BY-SA by Polonium
118118 array( "All_system_messages" ), # http://tl.wiktionary.org/w/index.php?title=Suleras:All_system_messages&oldid=2765 GPL text generated by MediaWiki
119119 array( "Fundraising" ), # http://tl.wiktionary.org/w/index.php?title=MediaWiki:Sitenotice&oldid=5716 GFDL + CC-BY-SA, copied there by Sky Harbor.
 120+ array( "Headings" ), # https://bugzilla.wikimedia.org/28642
120121 );
121122 }
122123
Index: trunk/phase3/tests/parser/preprocess/Headings.txt
@@ -0,0 +1,70 @@
 2+These should become headings:
 3+
 4+== h ==<!--c1-->
 5+
 6+== h == <!--c1-->
 7+
 8+== h ==<!--c1-->
 9+
 10+== h == <!--c1-->
 11+
 12+== h ==<!--c1--><!--c2-->
 13+
 14+== h == <!--c1--><!--c2-->
 15+
 16+== h ==<!--c1--><!--c2-->
 17+
 18+== h == <!--c1--><!--c2-->
 19+
 20+== h == <!--c1--> <!--c2-->
 21+
 22+== h ==<!--c1--> <!--c2-->
 23+
 24+== h == <!--c1--> <!--c2-->
 25+
 26+== h ==<!--c1--><!--c2--><!--c3-->
 27+
 28+== h ==<!--c1--> <!--c2--><!--c3-->
 29+
 30+== h ==<!--c1--><!--c2--> <!--c3-->
 31+
 32+== h ==<!--c1--> <!--c2--> <!--c3-->
 33+
 34+== h == <!--c1--><!--c2--><!--c3-->
 35+
 36+== h == <!--c1--> <!--c2--><!--c3-->
 37+
 38+== h == <!--c1--><!--c2--> <!--c3-->
 39+
 40+== h == <!--c1--> <!--c2--> <!--c3-->
 41+
 42+== h ==<!--c1--><!--c2--><!--c3-->
 43+
 44+== h ==<!--c1--> <!--c2--><!--c3-->
 45+
 46+== h ==<!--c1--><!--c2--> <!--c3-->
 47+
 48+== h ==<!--c1--> <!--c2--> <!--c3-->
 49+
 50+== h == <!--c1--><!--c2--><!--c3-->
 51+
 52+== h == <!--c1--> <!--c2--><!--c3-->
 53+
 54+== h == <!--c1--><!--c2--> <!--c3-->
 55+
 56+== h == <!--c1--> <!--c2--> <!--c3-->
 57+
 58+
 59+Those are not working:
 60+
 61+== h ==<!--c1--> <!--c2-->
 62+
 63+== h == <!--c1--> <!--c2-->
 64+
 65+== h ==<!--c1--> <!--c2-->
 66+
 67+== h == x <!--c1--><!--c2--><!--c3-->
 68+
 69+== h ==<!--c1--> x <!--c2--><!--c3-->
 70+
 71+== h ==<!--c1--><!--c2--><!--c3--> x
Index: trunk/phase3/tests/parser/preprocess/Headings.expected
@@ -0,0 +1,71 @@
 2+<root>These should become headings:
 3+
 4+<h level="2" i="1">== h ==<comment>&lt;!--c1--&gt;</comment></h>
 5+
 6+<h level="2" i="2">== h == <comment>&lt;!--c1--&gt;</comment></h>
 7+
 8+<h level="2" i="3">== h ==<comment>&lt;!--c1--&gt;</comment> </h>
 9+
 10+<h level="2" i="4">== h == <comment>&lt;!--c1--&gt;</comment> </h>
 11+
 12+<h level="2" i="5">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment></h>
 13+
 14+<h level="2" i="6">== h == <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment></h>
 15+
 16+<h level="2" i="7">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment> </h>
 17+
 18+<h level="2" i="8">== h == <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment> </h>
 19+
 20+<h level="2" i="9">== h == <comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment></h>
 21+
 22+<h level="2" i="10">== h ==<comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment> </h>
 23+
 24+<h level="2" i="11">== h == <comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment> </h>
 25+
 26+<h level="2" i="12">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
 27+
 28+<h level="2" i="13">== h ==<comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
 29+
 30+<h level="2" i="14">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment></h>
 31+
 32+<h level="2" i="15">== h ==<comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment></h>
 33+
 34+<h level="2" i="16">== h == <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
 35+
 36+<h level="2" i="17">== h == <comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
 37+
 38+<h level="2" i="18">== h == <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment></h>
 39+
 40+<h level="2" i="19">== h == <comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment></h>
 41+
 42+<h level="2" i="20">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment> </h>
 43+
 44+<h level="2" i="21">== h ==<comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment> </h>
 45+
 46+<h level="2" i="22">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment> </h>
 47+
 48+<h level="2" i="23">== h ==<comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment> </h>
 49+
 50+<h level="2" i="24">== h == <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment> </h>
 51+
 52+<h level="2" i="25">== h == <comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment> </h>
 53+
 54+<h level="2" i="26">== h == <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment> </h>
 55+
 56+<h level="2" i="27">== h == <comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment> <comment>&lt;!--c3--&gt;</comment> </h>
 57+
 58+
 59+Those are not working:
 60+
 61+== h ==<comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment>
 62+
 63+== h == <comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment>
 64+
 65+== h ==<comment>&lt;!--c1--&gt;</comment> <comment>&lt;!--c2--&gt;</comment>
 66+
 67+== h == x <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>
 68+
 69+== h ==<comment>&lt;!--c1--&gt;</comment> x <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>
 70+
 71+== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment> x
 72+</root>
\ No newline at end of file

Follow-up revisions

RevisionCommit summaryAuthorDate
r87220Convert r86795 tests into a dataProviderplatonides21:33, 1 May 2011
r87348Follow up r87220. r86795 tests are now embedded into PreprocessorTest.phpplatonides19:53, 3 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86676Fix bug #28642 - wrong part->commentEnd set to abbutting comments...mah22:20, 21 April 2011
r86709Updated patch from Bergi re: r86676 with tested code to fix bug #28642mah14:25, 22 April 2011

Status & tagging log