X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FparserTests.txt;h=03763613a80f9574631d22ae7363b13c3ed81a61;hb=1bb1a2c843a6defa2961ea5acb66397e0ecd0f86;hp=72ea016ffc66a13da59cd63814dca529a2b2d9f4;hpb=56dcef68206b0b86e403306817a3c6f1465be140;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 72ea016ffc..03763613a8 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -1,12 +1,45 @@ # MediaWiki Parser test cases -# see also http://meta.wikimedia.org/wiki/Parser_testing +# Some taken from http://meta.wikimedia.org/wiki/Parser_testing +# All (C) their respective authors and released under the GPL +# +# The syntax should be fairly self-explanatory. +# +# Currently supported test options: +# One of the following three: +# +# (default) generate HTML output +# pst apply pre-save transform +# msg apply message transform +# +# Plus any combination of these: +# +# cat add category links +# ill add inter-language links +# subpage enable subpages (disabled by default) +# title=[[XXX]] run test using article title XXX +# disabled do not run test +# +# For testing purposes, temporary articles can created: +# !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle +# where '/' denotes a newline. +# This is the standard article assumed to exist. +!! article +Main Page +!! text +blah blah +!! endarticle + +### +### Basic tests +### !! test Blank input !! input !! result !! end + !! test Simple paragraph !! input @@ -25,6 +58,7 @@ Simple list
asdf+ !! end !! test -comment test 2 +Comment test 2 !! input asdf @@ -145,7 +182,7 @@ jkl !! end !! test -comment test 3 +Comment test 3 !! input asdf @@ -158,7 +195,7 @@ jkl !! end !! test -comment test 4 +Comment test 4 !! input asdfjkl !! result @@ -166,63 +203,411 @@ asdfjkl !! end +!! test +Comment spacing +!! input +a + b +c +!! result +
a +
+b ++
c +
+!! end + +### +### Preformatted text +### +!! test +Preformatted text +!! input + This is some + Preformatted text + With ''italic'' + And '''bold''' + And a [[Main Page|link]] +!! result +This is some +Preformatted text +With italic +And bold +And a link ++!! end + +### +### Definition lists +### +!! test +Simple definition +!! input +; name : Definition +!! result +
Non-bracketed: http://example.com +
+!! end +!! test +External links: numbered +!! input Numbered: [http://example.com] +Numbered: [http://example.net] +Numbered: [http://example.org] +!! result +Numbered: [1] +Numbered: [2] +Numbered: [3] +
+!!end +!! test +External links: specified text +!! input Specified text: [http://example.com link] +!! result +Specified text: link +
+!!end + +!! test +External links: trail +!! input +Linktrails should not work for external links: [http://example.com link]s +!! result +Linktrails should not work for external links: links +
+!! end -Trail (not sure if this is meant to work): [http://example.com link]s +!! test +External links: dollar sign in URL +!! input +http://example.com/1$2345 !! result -Non-bracketed: http://example.com -
Numbered: [1] (http://example.com) -
Specified text: link (http://example.com) -
Trail (not sure if this is meant to work): links (http://example.com) +
!! end -# todo: enable these !! test -!! disabled -External links +External links: dollar sign in URL (named) +!! input +[http://example.com/1$2345] +!! result +[1] +
+!!end + +!! test +External image !! input -Unrecognised characters (for no good reason): http://example.com/1$2345 [http://example.com/1$2345] External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png +!! result +External image:
+
External image from https:
+
Link to non-http image, no img tag: ftp://example.com/test.jpg +
+!! end + +!! test +External links: terminating separator +!! input Terminating separator: http://example.com/thing, +!! result +Terminating separator: http://example.com/thing, +
+!! end + +!! test +External links: intervening separator +!! input Intervening separator: http://example.com/1,2,3 +!! result +Intervening separator: http://example.com/1,2,3 +
+!! end + +!! test +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 +
+!! end + +!! test +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 +
+!!end + +!! test +External links: URL in text +!! input URL in text: [http://example.com http://example.com] +!! result +URL in text: http://example.com +
+!! end + +!! test +External links: Clickable images +!! input ja-style clickable images: [http://example.com http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png] +!! result + +!!end + +!! test +External links: raw ampersand +!! input Old & use: http://x&y -Escaping without &: http://x&y -!! result -Unrecognised characters (for no good reason): http://example.com/1$2345 -[http://example.com/1$2345]
-External image:
External image from https:
Link to non-http image, no img tag: ftp://example.com/test.jpg
-Terminating separator: http://example.com/thing,
-Intervening separator: http://example.com/1,2,3
-Old bug with URL in query: [http://example.com/thing?url=http://example.com -link]
-And again with mixed protocols: [ftp://example.com?url=http://example.com -link]
-URL in text: http://example.com (http://example.com)
-ja-style clickable images: (http://example.com)
Old & use: http://x&y
-Escaping without &: http://x&y
+!! result +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 + +!! test +External links: www.jpeg.org (bug 554) +!! input +http://www.jpeg.org +!!result + +!! end + +!! test +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] +
+!! end + +!! test +BUG 361: URL inside bracketed URL +!! input +[http://www.example.com/foo http://www.example.com/bar] +!! result + +!! 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 + +!! test +BUG 289: ">"-token in URL-tail +!! input +http://www.example.com/http://www.example.com/<hello> +
+!!end + +!! test +BUG 289: literal ">"-token in URL-tail +!! input +http://www.example.com/html +!! result +http://www.example.com/html +
+!!end + +!! test +BUG 289: ">"-token in bracketed URL +!! input +[http://www.example.com/http://www.example.com/"hello" +
+!!end + +!! test +BUG 289: literal double quote in bracketed URL +!! input +[http://www.example.com/"hello" stuff] +!! result + +!!end + +!! test +External links: invalid character +!! input +[http://www.example.com test] +!! result +