r5508 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5507‎ | r5508 | r5509 >
Date:21:20, 25 September 2004
Author:wmahan
Status:old
Tags:
Comment:
Work with $wgUseTidy again, and add more tests (we now have 100!)
Modified paths:
  • /trunk/phase3/maintenance/parserTests.php (modified) (history)
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -5,9 +5,14 @@
66 # The syntax should be fairly self-explanatory.
77 #
88 # Currently supported test options:
 9+# One of the following three:
 10+#
911 # (default) generate HTML output
1012 # pst apply pre-save transform
1113 # msg apply message transform
 14+#
 15+# Plus any combination of these:
 16+#
1217 # cat add category links
1318 # ill add inter-language links
1419 # subpage enable subpages (disabled by default)
@@ -1016,6 +1021,14 @@
10171022 </p>
10181023 !! end
10191024
 1025+!! test
 1026+Template from main namespace
 1027+!! input
 1028+{{:Main Page}}
 1029+!! result
 1030+<p>blah blah
 1031+</p>
 1032+!! end
10201033
10211034 !! article
10221035 Template:table
@@ -1071,6 +1084,38 @@
10721085 </p>
10731086 !! end
10741087
 1088+
 1089+!! article
 1090+Template:MSGNW test
 1091+!! text
 1092+''None'' of '''this''' should be
 1093+* interepreted
 1094+ but rather passed unmodified
 1095+{{test}}
 1096+!! endarticle
 1097+
 1098+# hmm, fix this or just disable/deprecate msgnw?
 1099+!! test
 1100+msgnw keyword
 1101+!! input
 1102+{{msgnw:MSGNW test}}
 1103+!! result
 1104+<p>''None'' of '''this''' should be
 1105+* interepreted
 1106+ but rather passed unmodified
 1107+{{test}}
 1108+</p>
 1109+!! end
 1110+
 1111+!! test
 1112+int keyword
 1113+!! input
 1114+{{int:newmessages|lots of money}}
 1115+!! result
 1116+<p>You have lots of money.
 1117+</p>
 1118+!! end
 1119+
10751120 ###
10761121 ### Pre-save transform tests
10771122 ###
@@ -1228,20 +1273,19 @@
12291274 </p>
12301275 !! end
12311276
1232 -# bug 561: it would be nice if this linked to /subpage -- wtm
12331277 !! test
12341278 Disabled subpages
12351279 !! input
12361280 [[/subpage]]
12371281 !! result
1238 -<p><a href="https://www.mediawiki.org/index.php?title=Subpage&amp;action=edit" class="new" title="Subpage">subpage</a>
 1282+<p><a href="https://www.mediawiki.org/index.php?title=/subpage&amp;action=edit" class="new" title="/subpage">/subpage</a>
12391283 </p>
12401284 !! end
12411285
12421286 !! test
12431287 BUG 561: {{/Subpage}}
12441288 !! options
1245 -title=[[Page]]
 1289+subpage title=[[Page]]
12461290 !! input
12471291 {{/Subpage}}
12481292 !! result
@@ -1374,6 +1418,41 @@
13751419
13761420 !! end
13771421
 1422+!! article
 1423+Template:sections
 1424+!! text
 1425+===Section 1===
 1426+==Section 2==
 1427+!! endarticle
 1428+
 1429+!! test
 1430+Template with sections, __NOTOC__
 1431+!! options title=[[Parser test script]]
 1432+!! input
 1433+__NOTOC__
 1434+==Section 0==
 1435+{{sections}}
 1436+==Section 4==
 1437+!! result
 1438+<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Parser_test_script&amp;action=edit&amp;section=1" title="Parser test script">edit</a>]</div><a name="Section_0"></a><h2>Section 0</h2>
 1439+<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Template:Sections&amp;action=edit&amp;section=1" title="Template:Sections">edit</a>]</div><a name="Section_1"></a><h3>Section 1</h3>
 1440+<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Template:Sections&amp;action=edit&amp;section=2" title="Template:Sections">edit</a>]</div><a name="Section_2"></a><h2>Section 2</h2>
 1441+<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Parser_test_script&amp;action=edit&amp;section=2" title="Parser test script">edit</a>]</div><a name="Section_4"></a><h2>Section 4</h2>
 1442+
 1443+!! end
 1444+
 1445+!! test
 1446+__NOEDITSECTION__ keyword
 1447+!! input
 1448+__NOEDITSECTION__
 1449+==Section 1==
 1450+==Section 2==
 1451+!! result
 1452+<a name="Section_1"></a><h2>Section 1</h2>
 1453+<a name="Section_2"></a><h2>Section 2</h2>
 1454+
 1455+!! end
 1456+
13781457 TODO:
13791458 more images
13801459 more tables
Index: trunk/phase3/maintenance/parserTests.php
@@ -232,6 +232,7 @@
233233 }
234234
235235 if ($GLOBALS['wgUseTidy']) {
 236+ $out = Parser::tidy($out);
236237 $result = Parser::tidy($result);
237238 }
238239 }
@@ -265,7 +266,7 @@
266267
267268 'wgLoadBalancer' => LoadBalancer::newFromParams( $GLOBALS['wgDBservers'] ),
268269 'wgLang' => new LanguageUtf8(),
269 - 'wgNamespacesWithSubpages' => array( 0 => preg_match('/subpage/i', $opts)),
 270+ 'wgNamespacesWithSubpages' => array( 0 => preg_match('/\\bsubpage\\b/i', $opts)),
270271 );
271272 $this->savedGlobals = array();
272273 foreach( $settings as $var => $val ) {

Status & tagging log