X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FparserTests.txt;h=10bdf0d658611b474362412962275acecd66299e;hb=63a6b8e0a3740660912c6052549933ac6e1cc277;hp=a9c9db2b6ff8a8c5cfc450b795a39542936dd3a0;hpb=b126d37c7fe8e71539b9aeae06b31075fad35d26;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index a9c9db2b6f..10bdf0d658 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -18,7 +18,8 @@ # subpage enable subpages (disabled by default) # noxml don't check for XML well formdness # title=[[XXX]] run test using article title XXX -# language=XXX set content language to XXX for this test +# language=XXX set content language to XXX for this test +# variant=XXX set the variant of language for this test (eg zh-tw) # disabled do not run test # # For testing purposes, temporary articles can created: @@ -32,6 +33,23 @@ Main Page blah blah !! endarticle +!!article +Template:Foo +!!text +FOO +!!endarticle + +!! article +Template:Blank +!! text +!! endarticle + +!! article +Template:! +!! text +| +!! endarticle + ### ### Basic tests ### @@ -80,6 +98,7 @@ Italics and bold * plain''italic'''bold-italic'''''plain * plain'''bold''bold-italic'''''plain * plain l'''italic''plain +* plain l''''bold''' plain !! result
--> +
-->
!! end @@ -263,7 +283,7 @@ Comment semantics: nesting !! input --> !! result ---> +
-->
!! end @@ -275,6 +295,26 @@ Comment semantics: unclosed comment at end !! end +!! test +Comment in template title +!! input +{{foo}} +!! result +FOO +
+!! end + +!! test +Comment on its own line post-expand +!! input +a +{{blank}} +b +!! result +a +
b +
+!! end ### ### Preformatted text @@ -421,7 +461,7 @@ Definition list with wikilink containing colon !! input ; [[Help:FAQ]]: The least-read page on Wikipedia !! result -wikilink embedded in ext link +
!! end @@ -982,7 +1022,23 @@ External link containing double-single-quotes in text embedded in italics (bug 4 !! end +!! test +URL-encoding in URL functions (single parameter) +!! input +{{localurl:Some page|amp=&}} +!! result +/index.php?title=Some_page&=%26 +
+!! end +!! test +URL-encoding in URL functions (multiple parameters) +!! input +{{localurl:Some page|q=?&=&}} +!! result +/index.php?title=Some_page&q=%3F&=%26 +
+!! end ### ### Quotes @@ -1210,7 +1266,7 @@ Invalid attributes in table cell (bug 1830) # FIXME: this one has incorrect tag nesting still. !! test -TODO: Table security: embedded pipes (http://mail.wikipedia.org/pipermail/wikitech-l/2006-April/034637.html) +Table security: embedded pipes (http://lists.wikimedia.org/mailman/htdig/wikitech-l/2006-April/022293.html) !! input {| | |[ftp://|x||]" onmouseover="alert(document.cookie)">test @@ -1260,7 +1316,7 @@ Broken link !! input [[Zigzagzogzagzig]] !! result - !! end @@ -1314,7 +1370,7 @@ Link to namespaces !! input [[Talk:Parser testing]], [[Meta:Disclaimers]] !! result -Talk:Parser testing, Meta:Disclaimers +
Talk:Parser testing, Meta:Disclaimers
!! end @@ -1323,7 +1379,7 @@ Piped link to namespace !! input [[Meta:Disclaimers|The disclaimers]] !! result - !! end @@ -1341,7 +1397,7 @@ Link containing % (not as a hex sequence) !! input [[7% Solution]] !! result - !! end @@ -1350,7 +1406,7 @@ Link containing % as a single hex sequence interpreted to char !! input [[7%25 Solution]] !! result - !!end @@ -1383,7 +1439,7 @@ Link containing "<#" and ">#" as a hex sequences !! end !! test -TODO: Link containing double-single-quotes '' (bug 4598) +Link containing double-single-quotes '' (bug 4598) !! input [[Lista d''e paise d''o munno]] !! result @@ -1396,7 +1452,7 @@ Link containing double-single-quotes '' in text (bug 4598 sanity check) !! input Some [[Link|pretty ''italics'' and stuff]]! !! result -Some pretty italics and stuff! +
Some pretty italics and stuff!
!! end @@ -1405,7 +1461,7 @@ Link containing double-single-quotes '' in text embedded in italics (bug 4598 sa !! input ''Some [[Link|pretty ''italics'' and stuff]]! !! result -Some pretty italics and stuff! +
Some pretty italics and stuff!
!! end @@ -1469,6 +1525,34 @@ title=[[Main Page]] !! end +!! article +00 +!! text +This is 00. +!! endarticle + +!!test +Self-link to numeric title +!!options +title=[[0]] +!!input +[[0]] +!!result +0 +
+!!end + +!!test +Link to numeric-equivalent title +!!options +title=[[0]] +!!input +[[00]] +!!result +00 +
+!!end + !! testBlah blah blah +
+!! end + +!! test +Double interlanguage link +!! input +Blah blah blah +[[es:Spanish]] +[[zh:Chinese]] +!!result +Blah blah blah +
+!! end + +!! test +Interlanguage link, with prefix links +!! options +language=ln +!! input +Blah blah blah +[[zh:Chinese]] +!!result +Blah blah blah +
+!! end + +!! test +Double interlanguage link, with prefix links (bug 8897) +!! options +language=ln +!! input +Blah blah blah +[[es:Spanish]] +[[zh:Chinese]] +!!result +Blah blah blah +
+!! end + + ## ## XHTML tidiness ### @@ -1811,7 +1942,7 @@ Magic Word: {{NUMBEROFARTICLES}} !! input {{NUMBEROFARTICLES}} !! result -1 +
2
!! end @@ -1953,7 +2084,7 @@ Magic links: internal link to RFC (bug 479) !! input [[RFC 123]] !! result -RFC 123 +
!! end @@ -1962,7 +2093,7 @@ Magic links: RFC (bug 479) !! input RFC 822 !! result -RFC 822 +
!! end @@ -1971,7 +2102,7 @@ Magic links: ISBN (bug 1937) !! input ISBN 0-306-40615-2 !! result - !! end @@ -1993,7 +2124,7 @@ Nonexistant template !! input {{thistemplatedoesnotexist}} !! result -Template:Thistemplatedoesnotexist +
Template:Thistemplatedoesnotexist
!! end @@ -2175,7 +2306,7 @@ Template with thumb image (with link in description) {{paramtest| param =[[Image:noimage.png|thumb|[[no link|link]] [[no link|caption]]]]}} !! result -This is a test template with parameter +This is a test template with parameter !! end @@ -2284,7 +2415,7 @@ Template infinite loop !! input {{loop1}} !! result -loop1 +
Template loop detected: Template:Loop1
!! end @@ -2449,6 +2580,64 @@ FooImage:test !! input [[:Image:test]] @@ -2901,7 +3090,7 @@ Frameless image caption with a free URL !! input [[Image:foobar.jpg|http://example.com]] !! result -
!! end @@ -2910,16 +3099,16 @@ Thumbnail image caption with a free URL !! input [[Image:foobar.jpg|thumb|http://example.com]] !! result - + !! end !! test BUG 1887: A ISBN with a thumbnail !! input -[[Image:foobar.jpg|thumb|ISBN 12354]] +[[Image:foobar.jpg|thumb|ISBN 1235467890]] !! result - + !! end @@ -2928,7 +3117,7 @@ BUG 1887: A RFC with a thumbnail !! input [[Image:foobar.jpg|thumb|This is RFC 12354]] !! result -/subpage +
!! end @@ -3103,7 +3292,7 @@ subpage title=[[Page]] !! input {{/Subpage}} !! result - !! end @@ -3135,6 +3324,15 @@ cat MediaWiki User's Guide !! end +!! test +PAGESINCATEGORY invalid title fatal (r33546 fix) +!! input +{{PAGESINCATEGORY:0 +
+!! end + ### ### Inter-language links ### @@ -3277,6 +3475,80 @@ Handling of sections up to level 6 and beyond !! end +!! test +TOC regression (bug 9764) +!! input +== title 1 == +=== title 1.1 === +==== title 1.1.1 ==== +=== title 1.2 === +== title 2 == +=== title 2.1 === +!! result +Contents
|
Contents |
Contents |
C'est grave ! +
+!! end + +!! test +Punctuation: CSS !important (bug 11874) +!! input +Image1.png
- |
-Image2.gif
-|||| |
-Image3
- |
-Image4
-300px| centre |
-
Image5.svg |
-* image6
- |
-
+ Image1.png
+
+
+ |
+
+ Image2.gif
+
+
+ |||| + + |
+
+ Image3
+
+
+ |
+
+ Image4
+
+
+ 300px| centre + + |
+
+ Image5.svg
+
+
+
+ |
+
+ * image6
+
+
+ |
+
ISBN 983 987 +
!! end @@ -5770,12 +6114,10 @@ ISBN !! test Double ISBN -!! options -disabled # Disabled until Bug 6560 resolved !! input -ISBN ISBN 1234 +ISBN ISBN 1234567890 !! result -ISBN ISBN 1234 +
ISBN ISBN 1234567890
!! end @@ -5784,7 +6126,7 @@ Double RFC !! input RFC RFC 1234 !! result -RFC RFC 1234 +
RFC RFC 1234
!! end @@ -5793,7 +6135,7 @@ Double RFC with a wiki link !! input RFC [[RFC 1234]] !! result -RFC RFC 1234 +
RFC RFC 1234
!! end @@ -5802,7 +6144,7 @@ RFC code coverage !! input RFC 983 987 !! result -RFC 983 987 +
RFC 983 987
!! end @@ -5811,7 +6153,7 @@ Centre-aligned image !! input [[Image:foobar.jpg|centre]] !! result - + !!end @@ -5820,7 +6162,7 @@ None-aligned image !! input [[Image:foobar.jpg|none]] !! result - + !!end @@ -5829,7 +6171,7 @@ Width + Height sized image (using px) (height is ignored) !! input [[Image:foobar.jpg|640x480px]] !! result - !!end @@ -5846,16 +6188,16 @@ Another italics / bold test # XML error: Mismatched tag at byte 6120: # ...L2 +
!! end @@ -5910,7 +6252,7 @@ subpage title=[[Subpage test/L1/L2/L3]] !! input [[../]] !! result - !! end @@ -5924,33 +6266,33 @@ subpage title=[[Subpage test/L1/L2/L3]] !! input [[../../|L1]]2 !! result -L1 +
!! end # Question: should result be "/index.php?title=Subpage_test/L1&action=edit" instead? !! test -TODO: Parents of subpages, two levels up, without trailing slash or name. +Parents of subpages, two levels up, without trailing slash or name. !! options subpage title=[[Subpage test/L1/L2/L3]] !! input [[../..]] !! result -../.. +
!! end # Question: Why should the link text in the above test be "../..", yet in this test the "../.." part is silently dropped? # Current result:///
!! test
-TODO: Parents of subpages, two levels up, with lots of extra trailing slashes.
+Parents of subpages, two levels up, with lots of extra trailing slashes.
!! options
subpage title=[[Subpage test/L1/L2/L3]]
!! input
[[../../////]]
!! result
-
!! end
@@ -5969,7 +6311,7 @@ Definition list code coverage
!! end
!! test
-TODO: Don't fall for the self-closing div
+Don't fall for the self-closing div
!! input
[[:Template:Msg]]
+ [[:Template:Msg]]
ISBN 123456789 +
ISBN 12345678901 +
+!! end + + +!! test +ISBN with trailing year (bug 8110) +!! input +ISBN 1-234-56789-0 - 2006 + +ISBN 1 234 56789 0 - 2006 +!! result +ISBN 1-234-56789-0 - 2006 +
ISBN 1 234 56789 0 - 2006 +
+!! end + + !! test Pages in namespace (Magic word disabled currently) !! input @@ -6108,6 +6479,16 @@ Pages in namespace (Magic word disabled currently) !! end +!! test +anchorencode +!! input +{{anchorencode:foo bar©#%n}} +!! result +foo_bar.C2.A9.23.25n +
+!! end + + !! test Bug 8293: Use of center tag ruins paragraph formatting !! input @@ -6130,6 +6511,324 @@ bar !! end +### +### Language variants related tests +### +!! test +Self-link in language variants +!! options +title=[[Dunav]] language=sr +!! input +Both [[Dunav]] and [[ÐÑнав]] are names for this river. +!! result +Both Dunav and ÐÑнав are names for this river. +
+!!end + + +!! test +Link to pages in language variants +!! options +language=sr +!! input +Main Page can be written as [[Ðаин Ðаге]] +!! result +Main Page can be written as Ðаин Ðаге +
+!!end + + +!! test +Multiple links to pages in language variants +!! options +language=sr +!! input +[[Main Page]] can be written as [[Ðаин Ðаге]] same as [[Ðаин Ðаге]]. +!! result +Main Page can be written as Ðаин Ðаге same as Ðаин Ðаге. +
+!!end + + +!! test +Simple template in language variants +!! options +language=sr +!! input +{{ÑеÑÑ}} +!! result +This is a test template +
+!! end + + +!! test +Template with explicit namespace in language variants +!! options +language=sr +!! input +{{Template:ÑеÑÑ}} +!! result +This is a test template +
+!! end + + +!! test +Basic test for template parameter in language variants +!! options +language=sr +!! input +{{паÑамÑеÑÑ|param=foo}} +!! result +This is a test template with parameter foo +
+!! end + + +!! test +Simple category in language variants +!! options +language=sr cat +!! input +[[:Category:ÐедиаWики УÑеÑ'Ñ ÐÑиде]] +!! result +MediaWiki User's Guide +!! end + + +!! test +Stripping -{}- tags (language variants) +!! options +language=sr +!! input +Latin proverb: -{Ne nuntium necare}- +!! result +Latin proverb: Ne nuntium necare +
+!! end + + +!! test +Prevent conversion with -{}- tags (language variants) +!! options +language=sr variant=sr-ec +!! input +Latinski: -{Ne nuntium necare}- +!! result +ÐаÑинÑки: Ne nuntium necare +
+!! end + + +!! test +Prevent conversion of text with -{}- tags (language variants) +!! options +language=sr variant=sr-ec +!! input +Latinski: -{Ne nuntium necare}- +!! result +ÐаÑинÑки: Ne nuntium necare +
+!! end + + +!! test +Prevent conversion of links with -{}- tags (language variants) +!! options +language=sr variant=sr-ec +!! input +-{[[Main Page]]}- +!! result + +!! end + + +!! test +-{}- tags within headlines (within html for parserConvert()) +!! options +language=sr variant=sr-ec +!! input +== -{Naslov}- == +!! result +Taiwan, not China +
+!! end + + +!! test +Adding explicit session-wise language variant mapping (A flag) +!! options +language=zh variant=zh-tw +!! input +-{A|zh:China;zh-tw:Taiwan}- is China +!! result +Taiwan is Taiwan +
+!! end + + +!! test +Adding explicit conversion rule for title (T flag) +!! options +language=zh variant=zh-tw +!! input +Should be stripped-{T|zh:China;zh-tw:Taiwan}-! +!! result +Should be stripped! +
+!! end + + +!! test +Raw output of variant escape tags (R flag) +!! options +language=zh variant=zh-tw +!! input +Raw: -{R|zh:China;zh-tw:Taiwan}- +!! result +Raw: zh:China;zh-tw:Taiwan +
+!! end + + +!! test +Do not convert roman numbers to language variants +!! options +language=sr variant=sr-ec +!! input +Fridrih IV je car. +!! result +ФÑидÑÐ¸Ñ IV Ñе ÑаÑ. +
+!! end + +!!article +Template:Bullet +!!text +* Bar +!!endarticle + +!! test +Bug 529: Uncovered bullet +!! input +* Foo {{bullet}} +!! result +x +
+1 | 2 + |
3 | 4 + |
y +
+!! end + +!! test +Bug 529: Uncovered bullet in parser function result +!! input +* Foo {{lc:{{bullet}} }} +!! result +{{{1}}} +
+!! end + +!! test +Bug 5678: Double-parsed template invocation +!! input +{{lc:{{paramtest {{!}} param = hello }} }} +!! result +{{paramtest | param = hello }} +
+!! end + +!! test +Morwen/13: Unclosed link followed by heading +!! input +[[link +==heading== +!! result +[[link +
+{{foo| +
+{{foo| +
+