X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;ds=sidebyside;f=maintenance%2FparserTests.txt;h=c0d8f6f71693dce78fca86c80628111ac9920d3b;hb=16047ca2b774ca2e025cc566b0b3c5d20a99f676;hp=23bf77b44f4086a4cccd977467e1953a6fe90565;hpb=4b42f18b66e843f362e5e159d95fee9d2c26ef9c;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 23bf77b44f..c0d8f6f716 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -1,4 +1,4 @@ -# MediaWiki Parser test cases +# MediaWiki Parser test cases # Some taken from http://meta.wikimedia.org/wiki/Parser_testing # All (C) their respective authors and released under the GPL # @@ -16,6 +16,7 @@ # cat add category links # ill add inter-language links # subpage enable subpages (disabled by default) +# noxml don't check for XML well formdness # title=[[XXX]] run test using article title XXX # disabled do not run test # @@ -156,7 +157,7 @@ nowiki 3 !! end ### -### comment test cases +### Comments ### !! test Comment test 1 @@ -218,6 +219,53 @@ c
!! end +!! test +Comment whitespace +!! input + +!! result + +!! end + +!! test +Comment semantics and delimiters +!! input + +!! result + +!! end + +!! test +Comment semantics and delimiters, redux +!! input + +!! result + +!! end + +!! test +Comment semantics and delimiters: directors cut +!! input +--> +!! result +--> +
+!! end + +!! test +Comment semantics: nesting +!! input +--> +!! result +--> +
+!! end + + ### ### Preformatted text ### @@ -239,7 +287,7 @@ And a link !! end ### -### Definition list +### Definition lists ### !! test Simple definition @@ -276,7 +324,7 @@ Definition list with URL link !! input ; http://example.com/ : definition !! result -Non-bracketed: http://example.com +
Non-bracketed: http://example.com
!! end @@ -349,8 +397,12 @@ Non-bracketed: http://example.com External links: numbered !! input Numbered: [http://example.com] +Numbered: [http://example.net] +Numbered: [http://example.org] !! result -Numbered: [1] (http://example.com) +
Numbered: [1] +Numbered: [2] +Numbered: [3]
!!end @@ -359,16 +411,16 @@ External links: specified text !! input Specified text: [http://example.com link] !! result -Specified text: link (http://example.com) +
Specified text: link
!!end !! test External links: trail !! input -Trail (not sure if this is meant to work): [http://example.com link]s +Linktrails should not work for external links: [http://example.com link]s !! result -Trail (not sure if this is meant to work): links (http://example.com) +
Linktrails should not work for external links: links
!! end @@ -377,7 +429,7 @@ External links: dollar sign in URL !! input http://example.com/1$2345 !! result - !! end @@ -386,7 +438,25 @@ External links: dollar sign in URL (named) !! input [http://example.com/1$2345] !! result -[1] (http://example.com/1$2345) +
[1] +
+!!end + +!! test +External links: open square bracket forbidden in URL (bug 4377) +!! input +http://example.com/1[2345 +!! result +http://example.com/1[2345 +
+!! end + +!! test +External links: open square bracket forbidden in URL (named) (bug 4377) +!! input +[http://example.com/1[2345] +!! result + !!end @@ -413,7 +483,7 @@ Link to non-http image, no img tag !! input Link to non-http image, no img tag: ftp://example.com/test.jpg !! result -Link to non-http image, no img tag: ftp://example.com/test.jpg +
Link to non-http image, no img tag: ftp://example.com/test.jpg
!! end @@ -422,7 +492,7 @@ External links: terminating separator !! input Terminating separator: http://example.com/thing, !! result -Terminating separator: http://example.com/thing, +
Terminating separator: http://example.com/thing,
!! end @@ -431,7 +501,7 @@ External links: intervening separator !! input Intervening separator: http://example.com/1,2,3 !! result -Intervening separator: http://example.com/1,2,3 +
Intervening separator: http://example.com/1,2,3
!! end @@ -440,7 +510,7 @@ External links: old bug with URL in query !! input Old bug with URL in query: [http://example.com/thing?url=http://example.com link] !! result -Old bug with URL in query: link (http://example.com/thing?url=http://example.com) +
Old bug with URL in query: link
!! end @@ -449,7 +519,7 @@ External links: old URL-in-URL bug, mixed protocols !! input And again with mixed protocols: [ftp://example.com?url=http://example.com link] !! result -And again with mixed protocols: link (ftp://example.com?url=http://example.com) +
And again with mixed protocols: link
!!end @@ -458,7 +528,7 @@ External links: URL in text !! input URL in text: [http://example.com http://example.com] !! result -URL in text: http://example.com +
URL in text: http://example.com
!! end @@ -467,7 +537,7 @@ External links: Clickable images !! input ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] !! result -ja-style clickable images: (http://example.com)
+
Old & use: http://x&y +
Old & use: http://x&y +
+!! end + +!! test +External links: encoded ampersand +!! input +Old & use: http://x&y +!! result +Old & use: http://x&y +
+!! end + +!! test +External links: [raw ampersand] +!! input +Old & use: [http://x&y] +!! result +Old & use: [1] +
+!! end + +!! test +External links: [encoded ampersand] +!! input +Old & use: [http://x&y] +!! result +Old & use: [1]
!! end @@ -485,7 +582,7 @@ External links: www.jpeg.org (bug 554) !! input http://www.jpeg.org !!result - !! end @@ -494,7 +591,7 @@ External links: URL within URL (original bug 2) !! input [http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp] !! result -[1] (http://www.unausa.org/newindex.asp?place=http://www.unausa.org/programs/mun.asp) +
!! end @@ -503,7 +600,16 @@ BUG 361: URL inside bracketed URL !! input [http://www.example.com/foo http://www.example.com/bar] !! result -http://www.example.com/bar (http://www.example.com/foo) +
+!! end + +!! test +BUG 361: URL within URL, not bracketed +!! input +http://www.example.com/foo?=http://www.example.com/bar +!! result +http://www.example.com/foo?=http://www.example.com/bar
!! end @@ -512,7 +618,7 @@ BUG 289: ">"-token in URL-tail !! input http://www.example.com/http://www.example.com/<hello> +
http://www.example.com/<hello>
!!end @@ -521,7 +627,7 @@ BUG 289: literal ">"-token in URL-tail !! input http://www.example.com/html !! result -http://www.example.com/html +
!!end @@ -530,7 +636,7 @@ BUG 289: ">"-token in bracketed URL !! input [http://www.example.com/<hello> stuff (http://www.example.com/) +
!!end @@ -539,7 +645,7 @@ BUG 289: literal ">"-token in bracketed URL !! input [http://www.example.com/html stuff] !! result -html stuff (http://www.example.com/) +
!!end @@ -548,7 +654,7 @@ BUG 289: literal double quote at end of URL !! input http://www.example.com/"hello" !! result -http://www.example.com/"hello" +
http://www.example.com/"hello"
!!end @@ -557,19 +663,134 @@ BUG 289: literal double quote in bracketed URL !! input [http://www.example.com/"hello" stuff] !! result -"hello" stuff (http://www.example.com/) +
!!end !! test External links: invalid character !! input -[http://www.example.com test] +[http://www.example.com test] +!! result +[http://www.example.com test] +
+!! end + +!! test +External links: multiple legal whitespace is fine, Magnus. Don't break it please. (bug 5081) +!! input +[http://www.example.com test] +!! result +test +
+!! end + +!! test +BUG 787: Links with one slash after the url protocol are invalid +!! input +http:/example.com + +[http:/example.com title] +!! result +http:/example.com +
[http:/example.com title] +
+!! end + +!! test +Bug 2702: Mismatched and tags are invalid +!! input +''[http://example.com text''] +!! result +text +
+!! end + + +!! test +Bug 4781: %26 in URL +!! input +http://www.example.com/?title=AT%26T +!! result +http://www.example.com/?title=AT%26T +
+!! end + +!! test +Bug 4781, 5267: %26 in URL +!! input +http://www.example.com/?title=100%25_Bran +!! result +http://www.example.com/?title=100%25_Bran +
+!! end + +!! test +Bug 4781, 5267: %28, %29 in URL +!! input +http://www.example.com/?title=Ben-Hur_%281959_film%29 +!! result +http://www.example.com/?title=Ben-Hur_%281959_film%29 +
+!! end + + +!! test +Bug 4781: %26 in autonumber URL +!! input +[http://www.example.com/?title=AT%26T] +!! result +[1] +
+!! end + +!! test +Bug 4781, 5267: %26 in autonumber URL +!! input +[http://www.example.com/?title=100%25_Bran] +!! result +[1] +
+!! end + +!! test +Bug 4781, 5267: %28, %29 in autonumber URL +!! input +[http://www.example.com/?title=Ben-Hur_%281959_film%29] +!! result +[1] +
+!! end + + +!! test +Bug 4781: %26 in bracketed URL +!! input +[http://www.example.com/?title=AT%26T link] +!! result +link +
+!! end + +!! test +Bug 4781, 5267: %26 in bracketed URL +!! input +[http://www.example.com/?title=100%25_Bran link] +!! result +link +
+!! end + +!! test +Bug 4781, 5267: %28, %29 in bracketed URL +!! input +[http://www.example.com/?title=Ben-Hur_%281959_film%29 link] !! result -