Index: trunk/phase3/maintenance/parserTests.txt |
— | — | @@ -12,9 +12,8 @@ |
13 | 13 | # ill add inter-language links |
14 | 14 | # subpage enable subpages (disabled by default) |
15 | 15 | # title=[[XXX]] run test using article title XXX |
| 16 | +# disabled do not run test |
16 | 17 | # |
17 | | -# Tests can be disabled with the '!!disabled' flag. |
18 | | -# |
19 | 18 | # For testing purposes, temporary articles can created: |
20 | 19 | # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle |
21 | 20 | # where '/' denotes a newline. |
— | — | @@ -413,6 +412,15 @@ |
414 | 413 | </p> |
415 | 414 | !! end |
416 | 415 | |
| 416 | +!! test |
| 417 | +External links: URL within URL (original bug 2) |
| 418 | +!! input |
| 419 | +[http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp] |
| 420 | +!! result |
| 421 | +<p><a href="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp" class='external' title="http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp">[1]</a><span class='urlexpansion'> (<i>http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp</i>)</span> |
| 422 | +</p> |
| 423 | +!! end |
| 424 | + |
417 | 425 | ### |
418 | 426 | ### Quotes |
419 | 427 | ### |
— | — | @@ -690,6 +698,16 @@ |
691 | 699 | !! end |
692 | 700 | |
693 | 701 | !! test |
| 702 | +Link containing } |
| 703 | +!! input |
| 704 | +[[Usually caused by a typo (oops}]] |
| 705 | +!! result |
| 706 | +<p>[[Usually caused by a typo (oops}]] |
| 707 | +</p> |
| 708 | +!! end |
| 709 | + |
| 710 | + |
| 711 | +!! test |
694 | 712 | Plain link to URL |
695 | 713 | !! input |
696 | 714 | [[http://www.example.org]] |
— | — | @@ -869,8 +887,9 @@ |
870 | 888 | !! end |
871 | 889 | |
872 | 890 | ### |
873 | | -### Nonexistant template |
874 | | -### |
| 891 | +### Templates |
| 892 | +#### |
| 893 | + |
875 | 894 | !! test |
876 | 895 | Nonexistant template |
877 | 896 | !! input |
— | — | @@ -880,9 +899,6 @@ |
881 | 900 | </p> |
882 | 901 | !! end |
883 | 902 | |
884 | | -### |
885 | | -### Templates |
886 | | -#### |
887 | 903 | !! article |
888 | 904 | Template:test |
889 | 905 | !! text |
— | — | @@ -1001,6 +1017,60 @@ |
1002 | 1018 | !! end |
1003 | 1019 | |
1004 | 1020 | |
| 1021 | +!! article |
| 1022 | +Template:table |
| 1023 | +!! text |
| 1024 | +{| |
| 1025 | +| 1 || 2 |
| 1026 | +|- |
| 1027 | +| 3 || 4 |
| 1028 | +|} |
| 1029 | +!! endarticle |
| 1030 | + |
| 1031 | +!! test |
| 1032 | +BUG 529: Template with table, not included at beginning of line |
| 1033 | +!! input |
| 1034 | +foo {{table}} |
| 1035 | +!! result |
| 1036 | +<p>foo |
| 1037 | +</p> |
| 1038 | +<table > |
| 1039 | +<tr > |
| 1040 | +<td> 1 </td><td> 2 |
| 1041 | +</td></tr> |
| 1042 | +<tr > |
| 1043 | +<td> 3 </td><td> 4 |
| 1044 | +</td></tr></table> |
| 1045 | + |
| 1046 | +!! end |
| 1047 | + |
| 1048 | +!! test |
| 1049 | +BUG 523: Template shouldn't eat newline (or add an extra one before table) |
| 1050 | +!! input |
| 1051 | +foo |
| 1052 | +{{table}} |
| 1053 | +!! result |
| 1054 | +<p>foo |
| 1055 | +</p> |
| 1056 | +<table > |
| 1057 | +<tr > |
| 1058 | +<td> 1 </td><td> 2 |
| 1059 | +</td></tr> |
| 1060 | +<tr > |
| 1061 | +<td> 3 </td><td> 4 |
| 1062 | +</td></tr></table> |
| 1063 | + |
| 1064 | +!! end |
| 1065 | + |
| 1066 | +!! test |
| 1067 | +BUG 41: Template parameters shown as broken links |
| 1068 | +!! input |
| 1069 | +{{{parameter}}} |
| 1070 | +!! result |
| 1071 | +<p>{{{parameter}}} |
| 1072 | +</p> |
| 1073 | +!! end |
| 1074 | + |
1005 | 1075 | ### |
1006 | 1076 | ### Pre-save transform tests |
1007 | 1077 | ### |
— | — | @@ -1168,6 +1238,17 @@ |
1169 | 1239 | </p> |
1170 | 1240 | !! end |
1171 | 1241 | |
| 1242 | +!! test |
| 1243 | +BUG 561: {{/Subpage}} |
| 1244 | +!! options |
| 1245 | +title=[[Page]] |
| 1246 | +!! input |
| 1247 | +{{/Subpage}} |
| 1248 | +!! result |
| 1249 | +<p><a href="https://www.mediawiki.org/index.php?title=Page/Subpage&action=edit" class="new" title="Page/Subpage">Page/Subpage</a> |
| 1250 | +</p> |
| 1251 | +!! end |
| 1252 | + |
1172 | 1253 | ### |
1173 | 1254 | ### Categories |
1174 | 1255 | ### |
— | — | @@ -1211,7 +1292,88 @@ |
1212 | 1293 | es:Alimento fr:Nourriture zh:食品 |
1213 | 1294 | !! end |
1214 | 1295 | |
| 1296 | +### |
| 1297 | +### Sections |
| 1298 | +### |
| 1299 | +!! test |
| 1300 | +Basic section headings |
| 1301 | +!! input |
| 1302 | +== Headline 1 == |
| 1303 | +Some text |
1215 | 1304 | |
| 1305 | +==Headline 2== |
| 1306 | +More |
| 1307 | +===Smaller headline=== |
| 1308 | +Blah blah |
| 1309 | +!! result |
| 1310 | +<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="Headline_1"></a><h2> Headline 1 </h2> |
| 1311 | +<p>Some text |
| 1312 | +</p> |
| 1313 | +<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="Headline_2"></a><h2>Headline 2</h2> |
| 1314 | +<p>More |
| 1315 | +</p> |
| 1316 | +<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Parser_test_script&action=edit&section=3" title="Parser test script">edit</a>]</div><a name="Smaller_headline"></a><h3>Smaller headline</h3> |
| 1317 | +<p>Blah blah |
| 1318 | +</p> |
| 1319 | +!! end |
| 1320 | + |
| 1321 | +!! test |
| 1322 | +Section headings with TOC |
| 1323 | +!! input |
| 1324 | +== Headline 1 == |
| 1325 | +=== Subheadline 1 === |
| 1326 | +===== Skipping a level ===== |
| 1327 | +====== Skipping a level ====== |
| 1328 | + |
| 1329 | +== Headline 2 == |
| 1330 | +Some text |
| 1331 | +===Another headline=== |
| 1332 | +!! result |
| 1333 | +<table border="0" id="toc"><tr id="toctitle"><td align="center"> |
| 1334 | +<b>Table of contents</b> <script type="text/javascript">showTocToggle("show","hide")</script></td></tr><tr id="tocinside"><td> |
| 1335 | +<div class="tocline"><a href="#Headline_1">1 Headline 1</a><br /></div> |
| 1336 | +<div class="tocindent"> |
| 1337 | +<p><a href="#Subheadline_1">1.1 Subheadline 1</a><br /> |
| 1338 | +</p> |
| 1339 | +<div class="tocindent"> |
| 1340 | +<div class="tocindent"> |
| 1341 | +<p><a href="#Skipping_a_level">1.1.1 Skipping a level</a><br /> |
| 1342 | +</p> |
| 1343 | +<div class="tocindent"> |
| 1344 | +<p><a href="#Skipping_a_level_2">1.1.1.1 Skipping a level</a><br /> |
| 1345 | +</p> |
| 1346 | +</div> |
| 1347 | +</div> |
| 1348 | +</div> |
| 1349 | +</div> |
| 1350 | +<div class="tocline"><a href="#Headline_2">2 Headline 2</a><br /></div> |
| 1351 | +<div class="tocindent"> |
| 1352 | +<p><a href="#Another_headline">2.1 Another headline</a><br /> |
| 1353 | +</p> |
| 1354 | +</div> |
| 1355 | +</td></tr></table> |
| 1356 | +<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="Headline_1"></a><h2> Headline 1 </h2> |
| 1357 | +<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="Subheadline_1"></a><h3> Subheadline 1 </h3> |
| 1358 | +<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Parser_test_script&action=edit&section=3" title="Parser test script">edit</a>]</div><a name="Skipping_a_level"></a><h5> Skipping a level </h5> |
| 1359 | +<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Parser_test_script&action=edit&section=4" title="Parser test script">edit</a>]</div><a name="Skipping_a_level_2"></a><h6> Skipping a level </h6> |
| 1360 | +<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Parser_test_script&action=edit&section=5" title="Parser test script">edit</a>]</div><a name="Headline_2"></a><h2> Headline 2 </h2> |
| 1361 | +<p>Some text |
| 1362 | +</p> |
| 1363 | +<div class="editsection" style="float:right;margin-left:5px;">[<a href="https://www.mediawiki.org/index.php?title=Parser_test_script&action=edit&section=6" title="Parser test script">edit</a>]</div><a name="Another_headline"></a><h3>Another headline</h3> |
| 1364 | + |
| 1365 | +!! end |
| 1366 | + |
| 1367 | +!! test |
| 1368 | +Resolving duplicate section names |
| 1369 | +!! input |
| 1370 | +== Foo bar == |
| 1371 | +==Foo bar== |
| 1372 | +!! result |
| 1373 | +<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="Foo_bar"></a><h2> Foo bar </h2> |
| 1374 | +<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="Foo_bar_2"></a><h2>Foo bar</h2> |
| 1375 | + |
| 1376 | +!! end |
| 1377 | + |
1216 | 1378 | TODO: |
1217 | 1379 | more images |
1218 | 1380 | more tables |