* Add preprocessor tests that Bergi supplied for Bug #28642
authorMark A. Hershberger <mah@users.mediawiki.org>
Sat, 23 Apr 2011 21:26:04 +0000 (21:26 +0000)
committerMark A. Hershberger <mah@users.mediawiki.org>
Sat, 23 Apr 2011 21:26:04 +0000 (21:26 +0000)
* Add Bergi to CREDITS

CREDITS
tests/parser/preprocess/Headings.expected [new file with mode: 0644]
tests/parser/preprocess/Headings.txt [new file with mode: 0644]
tests/phpunit/includes/parser/PreprocessorTest.php

diff --git a/CREDITS b/CREDITS
index 9445b97..50d9c3a 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -10,6 +10,7 @@ following names for their contribution to the product.
 * Aryeh Gregor
 * Ashar Voultoiz
 * Bertrand Grondin
+* Bergi
 * Brion Vibber
 * Bryan Tong Minh
 * Chad Horohoe
diff --git a/tests/parser/preprocess/Headings.expected b/tests/parser/preprocess/Headings.expected
new file mode 100644 (file)
index 0000000..ab3103c
--- /dev/null
@@ -0,0 +1,71 @@
+<root>These should become headings:
+
+<h level="2" i="1">== h ==<comment>&lt;!--c1--&gt;</comment></h>
+
+<h level="2" i="2">== h ==     <comment>&lt;!--c1--&gt;</comment></h>
+
+<h level="2" i="3">== h ==<comment>&lt;!--c1--&gt;</comment>   </h>
+
+<h level="2" i="4">== h ==     <comment>&lt;!--c1--&gt;</comment>      </h>
+
+<h level="2" i="5">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment></h>
+
+<h level="2" i="6">== h ==     <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment></h>
+
+<h level="2" i="7">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment>         </h>
+
+<h level="2" i="8">== h ==     <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment>    </h>
+
+<h level="2" i="9">== h ==     <comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment></h>
+
+<h level="2" i="10">== h ==<comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment>      </h>
+
+<h level="2" i="11">== h ==    <comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment>  </h>
+
+<h level="2" i="12">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="13">== h ==<comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="14">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="15">== h ==<comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="16">== h ==  <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="17">== h ==  <comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="18">== h ==  <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="19">== h ==  <comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment></h>
+
+<h level="2" i="20">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>  </h>
+
+<h level="2" i="21">== h ==<comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>  </h>
+
+<h level="2" i="22">== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment>  </h>
+
+<h level="2" i="23">== h ==<comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment>  </h>
+
+<h level="2" i="24">== h ==  <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>  </h>
+
+<h level="2" i="25">== h ==  <comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>  </h>
+
+<h level="2" i="26">== h ==  <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment>  </h>
+
+<h level="2" i="27">== h ==  <comment>&lt;!--c1--&gt;</comment>  <comment>&lt;!--c2--&gt;</comment>  <comment>&lt;!--c3--&gt;</comment>  </h>
+
+
+Those are not working:
+
+== h ==<comment>&lt;!--c1--&gt;</comment>      <comment>&lt;!--c2--&gt;</comment>
+
+== h ==        <comment>&lt;!--c1--&gt;</comment>      <comment>&lt;!--c2--&gt;</comment>
+
+== h ==<comment>&lt;!--c1--&gt;</comment>      <comment>&lt;!--c2--&gt;</comment>      
+
+== h == x <comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>  
+
+== h ==<comment>&lt;!--c1--&gt;</comment> x <comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment>  
+
+== h ==<comment>&lt;!--c1--&gt;</comment><comment>&lt;!--c2--&gt;</comment><comment>&lt;!--c3--&gt;</comment> x 
+</root>
\ No newline at end of file
diff --git a/tests/parser/preprocess/Headings.txt b/tests/parser/preprocess/Headings.txt
new file mode 100644 (file)
index 0000000..940afbe
--- /dev/null
@@ -0,0 +1,70 @@
+These should become headings:
+
+== h ==<!--c1-->
+
+== h ==        <!--c1-->
+
+== h ==<!--c1-->       
+
+== h ==        <!--c1-->       
+
+== h ==<!--c1--><!--c2-->
+
+== h ==        <!--c1--><!--c2-->
+
+== h ==<!--c1--><!--c2-->      
+
+== h ==        <!--c1--><!--c2-->      
+
+== h ==        <!--c1-->  <!--c2-->
+
+== h ==<!--c1-->  <!--c2-->    
+
+== h ==        <!--c1-->  <!--c2-->    
+
+== h ==<!--c1--><!--c2--><!--c3-->
+
+== h ==<!--c1-->  <!--c2--><!--c3-->
+
+== h ==<!--c1--><!--c2-->  <!--c3-->
+
+== h ==<!--c1-->  <!--c2-->  <!--c3-->
+
+== h ==  <!--c1--><!--c2--><!--c3-->
+
+== h ==  <!--c1-->  <!--c2--><!--c3-->
+
+== h ==  <!--c1--><!--c2-->  <!--c3-->
+
+== h ==  <!--c1-->  <!--c2-->  <!--c3-->
+
+== h ==<!--c1--><!--c2--><!--c3-->  
+
+== h ==<!--c1-->  <!--c2--><!--c3-->  
+
+== h ==<!--c1--><!--c2-->  <!--c3-->  
+
+== h ==<!--c1-->  <!--c2-->  <!--c3-->  
+
+== h ==  <!--c1--><!--c2--><!--c3-->  
+
+== h ==  <!--c1-->  <!--c2--><!--c3-->  
+
+== h ==  <!--c1--><!--c2-->  <!--c3-->  
+
+== h ==  <!--c1-->  <!--c2-->  <!--c3-->  
+
+
+Those are not working:
+
+== h ==<!--c1-->       <!--c2-->
+
+== h ==        <!--c1-->       <!--c2-->
+
+== h ==<!--c1-->       <!--c2-->       
+
+== h == x <!--c1--><!--c2--><!--c3-->  
+
+== h ==<!--c1--> x <!--c2--><!--c3-->  
+
+== h ==<!--c1--><!--c2--><!--c3--> x 
index 3906332..d6fc376 100644 (file)
@@ -116,6 +116,7 @@ class PreprocessorTest extends MediaWikiTestCase {
                        array( "Factorial" ), # http://en.wikipedia.org/w/index.php?title=Template:Factorial&oldid=98548758 GFDL + CC-BY-SA by Polonium
                        array( "All_system_messages" ), # http://tl.wiktionary.org/w/index.php?title=Suleras:All_system_messages&oldid=2765 GPL text generated by MediaWiki
                        array( "Fundraising" ), # http://tl.wiktionary.org/w/index.php?title=MediaWiki:Sitenotice&oldid=5716 GFDL + CC-BY-SA, copied there by Sky Harbor.
+                       array( "Headings" ), # https://bugzilla.wikimedia.org/28642
                );
        }