r5481 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5480‎ | r5481 | r5482 >
Date:05:58, 25 September 2004
Author:wmahan
Status:old
Tags:
Comment:
New tests for sections and various bugs
Modified paths:
  • /trunk/phase3/maintenance/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/parserTests.txt
@@ -12,9 +12,8 @@
1313 # ill add inter-language links
1414 # subpage enable subpages (disabled by default)
1515 # title=[[XXX]] run test using article title XXX
 16+# disabled do not run test
1617 #
17 -# Tests can be disabled with the '!!disabled' flag.
18 -#
1918 # For testing purposes, temporary articles can created:
2019 # !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
2120 # where '/' denotes a newline.
@@ -413,6 +412,15 @@
414413 </p>
415414 !! end
416415
 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+
417425 ###
418426 ### Quotes
419427 ###
@@ -690,6 +698,16 @@
691699 !! end
692700
693701 !! 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
694712 Plain link to URL
695713 !! input
696714 [[http://www.example.org]]
@@ -869,8 +887,9 @@
870888 !! end
871889
872890 ###
873 -### Nonexistant template
874 -###
 891+### Templates
 892+####
 893+
875894 !! test
876895 Nonexistant template
877896 !! input
@@ -880,9 +899,6 @@
881900 </p>
882901 !! end
883902
884 -###
885 -### Templates
886 -####
887903 !! article
888904 Template:test
889905 !! text
@@ -1001,6 +1017,60 @@
10021018 !! end
10031019
10041020
 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+
10051075 ###
10061076 ### Pre-save transform tests
10071077 ###
@@ -1168,6 +1238,17 @@
11691239 </p>
11701240 !! end
11711241
 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&amp;action=edit" class="new" title="Page/Subpage">Page/Subpage</a>
 1250+</p>
 1251+!! end
 1252+
11721253 ###
11731254 ### Categories
11741255 ###
@@ -1211,7 +1292,88 @@
12121293 es:Alimento fr:Nourriture zh:食品
12131294 !! end
12141295
 1296+###
 1297+### Sections
 1298+###
 1299+!! test
 1300+Basic section headings
 1301+!! input
 1302+== Headline 1 ==
 1303+Some text
12151304
 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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;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&amp;action=edit&amp;section=2" title="Parser test script">edit</a>]</div><a name="Foo_bar_2"></a><h2>Foo bar</h2>
 1375+
 1376+!! end
 1377+
12161378 TODO:
12171379 more images
12181380 more tables

Status & tagging log