r17083 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r17082‎ | r17083 | r17084 >
Date:09:22, 18 October 2006
Author:tstarling
Status:old
Tags:
Comment:
Added --show-output option to parserTests.php, to allow capture of complete output for test generation. Fixed various parser tests broken by tidy and incorrect capture method (i.e. web browser). Updated "Fuzz testing: Parser14-table", this appears to be fixed.
Modified paths:
  • /trunk/phase3/maintenance/parserTests.inc (modified) (history)
  • /trunk/phase3/maintenance/parserTests.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.inc
@@ -25,7 +25,7 @@
2626 */
2727
2828 /** */
29 -$options = array( 'quick', 'color', 'quiet', 'help' );
 29+$options = array( 'quick', 'color', 'quiet', 'help', 'show-output' );
3030 $optionsWithArgs = array( 'regex' );
3131
3232 require_once( 'commandLine.inc' );
@@ -54,6 +54,11 @@
5555 var $lightcolor;
5656
5757 /**
 58+ * boolean $showOutput Show test output
 59+ */
 60+ var $showOutput;
 61+
 62+ /**
5863 * Sets terminal colorization and diff/quick modes depending on OS and
5964 * command-line options (--color and --quick).
6065 *
@@ -82,9 +87,10 @@
8388 }
8489
8590 $this->showDiffs = !isset( $options['quick'] );
86 -
8791 $this->quiet = isset( $options['quiet'] );
 92+ $this->showOutput = isset( $options['show-output'] );
8893
 94+
8995 if (isset($options['regex'])) {
9096 $this->regex = $options['regex'];
9197 } else {
@@ -586,6 +592,9 @@
587593 $this->showTesting( $desc );
588594 }
589595 print $this->termColor( '1;31' ) . 'FAILED!' . $this->termReset() . "\n";
 596+ if ( $this->showOutput ) {
 597+ print "--- Expected ---\n$result\n--- Actual ---\n$html\n";
 598+ }
590599 if( $this->showDiffs ) {
591600 print $this->quickDiff( $result, $html );
592601 if( !$this->wellFormed( $html ) ) {
Index: trunk/phase3/maintenance/parserTests.php
@@ -26,22 +26,24 @@
2727 require('parserTests.inc');
2828
2929 if( isset( $options['help'] ) ) {
30 - echo <<<END
 30+ echo <<<ENDS
3131 MediaWiki $wgVersion parser test suite
32 -Usage: php parserTests.php [--quick] [--quiet] [--color[=(yes|no|light)]]
 32+Usage: php parserTests.php [--quick] [--quiet] [--show-output]
 33+ [--color[=(yes|no|light)]]
3334 [--regex=<expression>] [--file=<testfile>]
3435 [--help]
3536 Options:
36 - --quick Suppress diff output of failed tests
37 - --quiet Suppress notification of passed tests (shows only failed tests)
38 - --color Override terminal detection and force color output on or off
39 - 'light' option is similar to 'yes' but with color for dark backgrounds
40 - --regex Only run tests whose descriptions which match given regex
41 - --file Run test cases from a custom file instead of parserTests.txt
42 - --help Show this help message
 37+ --quick Suppress diff output of failed tests
 38+ --quiet Suppress notification of passed tests (shows only failed tests)
 39+ --show-output Show expected and actual output
 40+ --color Override terminal detection and force color output on or off
 41+ 'light' option is similar to 'yes' but with color for dark backgrounds
 42+ --regex Only run tests whose descriptions which match given regex
 43+ --file Run test cases from a custom file instead of parserTests.txt
 44+ --help Show this help message
4345
4446
45 -END;
 47+ENDS;
4648 exit( 0 );
4749 }
4850
Index: trunk/phase3/maintenance/parserTests.txt
@@ -3136,8 +3136,6 @@
31373137 ###
31383138 !! test
31393139 Basic section headings
3140 -!! options
3141 -title=[[Parser test script]]
31423140 !! input
31433141 == Headline 1 ==
31443142 Some text
@@ -3147,23 +3145,19 @@
31483146 ===Smaller headline===
31493147 Blah blah
31503148 !! result
3151 -<a name="Headline_1"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline"> Headline 1 </span></h2>
3152 -
 3149+<a name="Headline_1"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline"> Headline 1 </span></h2>
31533150 <p>Some text
31543151 </p>
3155 -<a name="Headline_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline">Headline 2</span></h2>
 3152+<a name="Headline_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline">Headline 2</span></h2>
31563153 <p>More
31573154 </p>
3158 -<a name="Smaller_headline"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=3" title="Edit section: Smaller headline">edit</a>]</span> <span class="mw-headline">Smaller headline</span></h3>
 3155+<a name="Smaller_headline"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Smaller headline">edit</a>]</span> <span class="mw-headline">Smaller headline</span></h3>
31593156 <p>Blah blah
3160 -
31613157 </p>
31623158 !! end
31633159
31643160 !! test
31653161 Section headings with TOC
3166 -!! options
3167 -title=[[Parser test script]]
31683162 !! input
31693163 == Headline 1 ==
31703164 === Subheadline 1 ===
@@ -3174,8 +3168,7 @@
31753169 Some text
31763170 ===Another headline===
31773171 !! result
3178 -<table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
3179 -
 3172+<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
31803173 <ul>
31813174 <li class="toclevel-1"><a href="#Headline_1"><span class="tocnumber">1</span> <span class="toctext">Headline 1</span></a>
31823175 <ul>
@@ -3184,7 +3177,6 @@
31853178 <li class="toclevel-3"><a href="#Skipping_a_level"><span class="tocnumber">1.1.1</span> <span class="toctext">Skipping a level</span></a>
31863179 <ul>
31873180 <li class="toclevel-4"><a href="#Skipping_a_level_2"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Skipping a level</span></a></li>
3188 -
31893181 </ul>
31903182 </li>
31913183 </ul>
@@ -3196,19 +3188,17 @@
31973189 <li class="toclevel-2"><a href="#Another_headline"><span class="tocnumber">2.1</span> <span class="toctext">Another headline</span></a></li>
31983190 </ul>
31993191 </li>
3200 -
32013192 </ul>
3202 -</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
3203 -<a name="Headline_1"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline"> Headline 1 </span></h2>
3204 -<a name="Subheadline_1"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Subheadline 1">edit</a>]</span> <span class="mw-headline"> Subheadline 1 </span></h3>
3205 -
3206 -<a name="Skipping_a_level"></a><h5><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=3" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline"> Skipping a level </span></h5>
3207 -<a name="Skipping_a_level_2"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=4" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline"> Skipping a level </span></h6>
3208 -<a name="Headline_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=5" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline"> Headline 2 </span></h2>
3209 -
 3193+</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 3194+<a name="Headline_1"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Headline 1">edit</a>]</span> <span class="mw-headline"> Headline 1 </span></h2>
 3195+<a name="Subheadline_1"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Subheadline 1">edit</a>]</span> <span class="mw-headline"> Subheadline 1 </span></h3>
 3196+<a name="Skipping_a_level"></a><h5><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline"> Skipping a level </span></h5>
 3197+<a name="Skipping_a_level_2"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Skipping a level">edit</a>]</span> <span class="mw-headline"> Skipping a level </span></h6>
 3198+<a name="Headline_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Headline 2">edit</a>]</span> <span class="mw-headline"> Headline 2 </span></h2>
32103199 <p>Some text
32113200 </p>
3212 -<a name="Another_headline"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=6" title="Edit section: Another headline">edit</a>]</span> <span class="mw-headline">Another headline</span></h3>
 3201+<a name="Another_headline"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Another headline">edit</a>]</span> <span class="mw-headline">Another headline</span></h3>
 3202+
32133203 !! end
32143204
32153205 # perl -e 'print "="x$_," Level $_ heading","="x$_,"\n" for 1..10'
@@ -3226,8 +3216,7 @@
32273217 ========= Level 9 Heading=========
32283218 ========== Level 10 Heading==========
32293219 !! result
3230 -<table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
3231 -
 3220+<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
32323221 <ul>
32333222 <li class="toclevel-1"><a href="#Level_1_Heading"><span class="tocnumber">1</span> <span class="toctext">Level 1 Heading</span></a>
32343223 <ul>
@@ -3236,14 +3225,12 @@
32373226 <li class="toclevel-3"><a href="#Level_3_Heading"><span class="tocnumber">1.1.1</span> <span class="toctext">Level 3 Heading</span></a>
32383227 <ul>
32393228 <li class="toclevel-4"><a href="#Level_4_Heading"><span class="tocnumber">1.1.1.1</span> <span class="toctext">Level 4 Heading</span></a>
3240 -
32413229 <ul>
32423230 <li class="toclevel-5"><a href="#Level_5_Heading"><span class="tocnumber">1.1.1.1.1</span> <span class="toctext">Level 5 Heading</span></a>
32433231 <ul>
32443232 <li class="toclevel-6"><a href="#Level_6_Heading"><span class="tocnumber">1.1.1.1.1.1</span> <span class="toctext">Level 6 Heading</span></a></li>
32453233 <li class="toclevel-6"><a href="#.3D_Level_7_Heading.3D"><span class="tocnumber">1.1.1.1.1.2</span> <span class="toctext">= Level 7 Heading=</span></a></li>
32463234 <li class="toclevel-6"><a href="#.3D.3D_Level_8_Heading.3D.3D"><span class="tocnumber">1.1.1.1.1.3</span> <span class="toctext">== Level 8 Heading==</span></a></li>
3247 -
32483235 <li class="toclevel-6"><a href="#.3D.3D.3D_Level_9_Heading.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.4</span> <span class="toctext">=== Level 9 Heading===</span></a></li>
32493236 <li class="toclevel-6"><a href="#.3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"><span class="tocnumber">1.1.1.1.1.5</span> <span class="toctext">==== Level 10 Heading====</span></a></li>
32503237 </ul>
@@ -3255,36 +3242,31 @@
32563243 </ul>
32573244 </li>
32583245 </ul>
3259 -
32603246 </li>
32613247 </ul>
3262 -</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
3263 -<a name="Level_1_Heading"></a><h1><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Level 1 Heading">edit</a>]</span> <span class="mw-headline"> Level 1 Heading</span></h1>
3264 -<a name="Level_2_Heading"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Level 2 Heading">edit</a>]</span> <span class="mw-headline"> Level 2 Heading</span></h2>
 3248+</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 3249+<a name="Level_1_Heading"></a><h1><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Level 1 Heading">edit</a>]</span> <span class="mw-headline"> Level 1 Heading</span></h1>
 3250+<a name="Level_2_Heading"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Level 2 Heading">edit</a>]</span> <span class="mw-headline"> Level 2 Heading</span></h2>
 3251+<a name="Level_3_Heading"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=3" title="Edit section: Level 3 Heading">edit</a>]</span> <span class="mw-headline"> Level 3 Heading</span></h3>
 3252+<a name="Level_4_Heading"></a><h4><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=4" title="Edit section: Level 4 Heading">edit</a>]</span> <span class="mw-headline"> Level 4 Heading</span></h4>
 3253+<a name="Level_5_Heading"></a><h5><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=5" title="Edit section: Level 5 Heading">edit</a>]</span> <span class="mw-headline"> Level 5 Heading</span></h5>
 3254+<a name="Level_6_Heading"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=6" title="Edit section: Level 6 Heading">edit</a>]</span> <span class="mw-headline"> Level 6 Heading</span></h6>
 3255+<a name=".3D_Level_7_Heading.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=7" title="Edit section: = Level 7 Heading=">edit</a>]</span> <span class="mw-headline">= Level 7 Heading=</span></h6>
 3256+<a name=".3D.3D_Level_8_Heading.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=8" title="Edit section: == Level 8 Heading==">edit</a>]</span> <span class="mw-headline">== Level 8 Heading==</span></h6>
 3257+<a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=9" title="Edit section: === Level 9 Heading===">edit</a>]</span> <span class="mw-headline">=== Level 9 Heading===</span></h6>
 3258+<a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</span> <span class="mw-headline">==== Level 10 Heading====</span></h6>
32653259
3266 -<a name="Level_3_Heading"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=3" title="Edit section: Level 3 Heading">edit</a>]</span> <span class="mw-headline"> Level 3 Heading</span></h3>
3267 -<a name="Level_4_Heading"></a><h4><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=4" title="Edit section: Level 4 Heading">edit</a>]</span> <span class="mw-headline"> Level 4 Heading</span></h4>
3268 -<a name="Level_5_Heading"></a><h5><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=5" title="Edit section: Level 5 Heading">edit</a>]</span> <span class="mw-headline"> Level 5 Heading</span></h5>
3269 -
3270 -<a name="Level_6_Heading"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=6" title="Edit section: Level 6 Heading">edit</a>]</span> <span class="mw-headline"> Level 6 Heading</span></h6>
3271 -<a name=".3D_Level_7_Heading.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=7" title="Edit section: = Level 7 Heading=">edit</a>]</span> <span class="mw-headline">= Level 7 Heading=</span></h6>
3272 -<a name=".3D.3D_Level_8_Heading.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=8" title="Edit section: == Level 8 Heading==">edit</a>]</span> <span class="mw-headline">== Level 8 Heading==</span></h6>
3273 -
3274 -<a name=".3D.3D.3D_Level_9_Heading.3D.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=9" title="Edit section: === Level 9 Heading===">edit</a>]</span> <span class="mw-headline">=== Level 9 Heading===</span></h6>
3275 -<a name=".3D.3D.3D.3D_Level_10_Heading.3D.3D.3D.3D"></a><h6><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=10" title="Edit section: ==== Level 10 Heading====">edit</a>]</span> <span class="mw-headline">==== Level 10 Heading====</span></h6>
32763260 !! end
32773261
32783262 !! test
32793263 Resolving duplicate section names
3280 -!! options
3281 -title=[[Parser test script]]
32823264 !! input
32833265 == Foo bar ==
32843266 == Foo bar ==
32853267 !! result
3286 -<a name="Foo_bar"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline"> Foo bar </span></h2>
 3268+<a name="Foo_bar"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline"> Foo bar </span></h2>
 3269+<a name="Foo_bar_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline"> Foo bar </span></h2>
32873270
3288 -<a name="Foo_bar_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Foo bar">edit</a>]</span> <span class="mw-headline"> Foo bar </span></h2>
32893271 !! end
32903272
32913273 !! article
@@ -3296,20 +3278,17 @@
32973279
32983280 !! test
32993281 Template with sections, __NOTOC__
3300 -!! options
3301 -title=[[Parser test script]]
33023282 !! input
33033283 __NOTOC__
33043284 ==Section 0==
33053285 {{sections}}
33063286 ==Section 4==
33073287 !! result
3308 -<a name="Section_0"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Section 0">edit</a>]</span> <span class="mw-headline">Section 0</span></h2>
 3288+<a name="Section_0"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section 0">edit</a>]</span> <span class="mw-headline">Section 0</span></h2>
 3289+<a name="Section_1"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Template:Sections&amp;action=edit&amp;section=1" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 1</span></h3>
 3290+<a name="Section_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Template:Sections&amp;action=edit&amp;section=2" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 2</span></h2>
 3291+<a name="Section_4"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=2" title="Edit section: Section 4">edit</a>]</span> <span class="mw-headline">Section 4</span></h2>
33093292
3310 -<a name="Section_1"></a><h3><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Template:Sections&amp;action=edit&amp;section=1" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 1</span></h3>
3311 -<a name="Section_2"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Template:Sections&amp;action=edit&amp;section=2" title="Template:Sections">edit</a>]</span> <span class="mw-headline">Section 2</span></h2>
3312 -<a name="Section_4"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Edit section: Section 4">edit</a>]</span> <span class="mw-headline">Section 4</span></h2>
3313 -
33143293 !! end
33153294
33163295 !! test
@@ -3320,18 +3299,17 @@
33213300 ==Section 2==
33223301 !! result
33233302 <a name="Section_1"></a><h2> <span class="mw-headline">Section 1</span></h2>
3324 -
33253303 <a name="Section_2"></a><h2> <span class="mw-headline">Section 2</span></h2>
 3304+
33263305 !! end
33273306
33283307 !! test
33293308 Link inside a section heading
3330 -!! options
3331 -title=[[Parser test script]]
33323309 !! input
33333310 ==Section with a [[Main Page|link]] in it==
33343311 !! result
3335 -<a name="Section_with_a_link_in_it"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a>]</span> <span class="mw-headline">Section with a <a href="https://www.mediawiki.org/phase3/index.php/Main_Page" title="Main Page">link</a> in it</span></h2>
 3312+<a name="Section_with_a_link_in_it"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: Section with a link in it">edit</a>]</span> <span class="mw-headline">Section with a <a href="https://www.mediawiki.org/wiki/Main_Page" title="Main Page">link</a> in it</span></h2>
 3313+
33363314 !! end
33373315
33383316
@@ -4471,13 +4449,12 @@
44724450 == onmouseover= ==
44734451 http://__TOC__
44744452 !! result
4475 -<a name="onmouseover.3D"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a>]</span> <span class="mw-headline"> onmouseover= </span></h2>
4476 -http://<table id="toc" class="toc" summary="Contents"><tbody><tr><td><div id="toctitle"><h2>Contents</h2> <span class="toctoggle">[<a href="javascript:toggleToc()" class="internal" id="togglelink">hide</a>]</span></div>
 4453+<a name="onmouseover.3D"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: onmouseover=">edit</a>]</span> <span class="mw-headline"> onmouseover= </span></h2>
 4454+http://<table id="toc" class="toc" summary="Contents"><tr><td><div id="toctitle"><h2>Contents</h2></div>
44774455 <ul>
44784456 <li class="toclevel-1"><a href="#onmouseover.3D"><span class="tocnumber">1</span> <span class="toctext">onmouseover=</span></a></li>
4479 -
44804457 </ul>
4481 -</td></tr></tbody></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
 4458+</td></tr></table><script type="text/javascript"> if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } </script>
44824459
44834460 !! end
44844461
@@ -4487,10 +4464,11 @@
44884465 ==a==
44894466 {| STYLE=__TOC__
44904467 !! result
4491 -<a name="a"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/phase3/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline">a</span></h2>
4492 -<table style="">
4493 -<tbody><tr><td></td></tr>
4494 -</tbody></table>
 4468+<a name="a"></a><h2><span class="editsection">[<a href="https://www.mediawiki.org/index.php?title=Parser_test&amp;action=edit&amp;section=1" title="Edit section: a">edit</a>]</span> <span class="mw-headline">a</span></h2>
 4469+<table style="&#95;_TOC&#95;_">
 4470+<tr><td></td></tr>
 4471+</table>
 4472+
44954473 !! end
44964474
44974475 # Known to produce bogus xml (extra </td>)
@@ -5873,4 +5851,4 @@
58745852 math
58755853 character entities
58765854 and much more
5877 -Try for 100% code coverage
\ No newline at end of file
 5855+Try for 100% code coverage