Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -5,9 +5,14 @@ |
6 | 6 | # The syntax should be fairly self-explanatory. |
7 | 7 | # |
8 | 8 | # Currently supported test options: |
| 9 | +# One of the following three: |
| 10 | +# |
9 | 11 | # (default) generate HTML output |
10 | 12 | # pst apply pre-save transform |
11 | 13 | # msg apply message transform |
| 14 | +# |
| 15 | +# Plus any combination of these: |
| 16 | +# |
12 | 17 | # cat add category links |
13 | 18 | # ill add inter-language links |
14 | 19 | # subpage enable subpages (disabled by default) |
— | — | @@ -1016,6 +1021,14 @@ |
1017 | 1022 | </p> |
1018 | 1023 | !! end |
1019 | 1024 | |
| 1025 | +!! test |
| 1026 | +Template from main namespace |
| 1027 | +!! input |
| 1028 | +{{:Main Page}} |
| 1029 | +!! result |
| 1030 | +<p>blah blah |
| 1031 | +</p> |
| 1032 | +!! end |
1020 | 1033 | |
1021 | 1034 | !! article |
1022 | 1035 | Template:table |
— | — | @@ -1071,6 +1084,38 @@ |
1072 | 1085 | </p> |
1073 | 1086 | !! end |
1074 | 1087 | |
| 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 | + |
1075 | 1120 | ### |
1076 | 1121 | ### Pre-save transform tests |
1077 | 1122 | ### |
— | — | @@ -1228,20 +1273,19 @@ |
1229 | 1274 | </p> |
1230 | 1275 | !! end |
1231 | 1276 | |
1232 | | -# bug 561: it would be nice if this linked to /subpage -- wtm |
1233 | 1277 | !! test |
1234 | 1278 | Disabled subpages |
1235 | 1279 | !! input |
1236 | 1280 | [[/subpage]] |
1237 | 1281 | !! result |
1238 | | -<p><a href="https://www.mediawiki.org/index.php?title=Subpage&action=edit" class="new" title="Subpage">subpage</a> |
| 1282 | +<p><a href="https://www.mediawiki.org/index.php?title=/subpage&action=edit" class="new" title="/subpage">/subpage</a> |
1239 | 1283 | </p> |
1240 | 1284 | !! end |
1241 | 1285 | |
1242 | 1286 | !! test |
1243 | 1287 | BUG 561: {{/Subpage}} |
1244 | 1288 | !! options |
1245 | | -title=[[Page]] |
| 1289 | +subpage title=[[Page]] |
1246 | 1290 | !! input |
1247 | 1291 | {{/Subpage}} |
1248 | 1292 | !! result |
— | — | @@ -1374,6 +1418,41 @@ |
1375 | 1419 | |
1376 | 1420 | !! end |
1377 | 1421 | |
| 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&action=edit&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&action=edit&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&action=edit&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&action=edit&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 | + |
1378 | 1457 | TODO: |
1379 | 1458 | more images |
1380 | 1459 | more tables |
Index: trunk/phase3/maintenance/parserTests.php |
— | — | @@ -232,6 +232,7 @@ |
233 | 233 | } |
234 | 234 | |
235 | 235 | if ($GLOBALS['wgUseTidy']) { |
| 236 | + $out = Parser::tidy($out); |
236 | 237 | $result = Parser::tidy($result); |
237 | 238 | } |
238 | 239 | } |
— | — | @@ -265,7 +266,7 @@ |
266 | 267 | |
267 | 268 | 'wgLoadBalancer' => LoadBalancer::newFromParams( $GLOBALS['wgDBservers'] ), |
268 | 269 | 'wgLang' => new LanguageUtf8(), |
269 | | - 'wgNamespacesWithSubpages' => array( 0 => preg_match('/subpage/i', $opts)), |
| 270 | + 'wgNamespacesWithSubpages' => array( 0 => preg_match('/\\bsubpage\\b/i', $opts)), |
270 | 271 | ); |
271 | 272 | $this->savedGlobals = array(); |
272 | 273 | foreach( $settings as $var => $val ) { |