X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=e62eb80f1171e096aa5d23acf5bd9ef9f33165de;hb=31a52f9e3d49d452f4aef95491de7ad75ed4ccc3;hp=dacc726ad597cba2eeac3a9a625aa4827a06f7b9;hpb=68d61cac82963f5b96786a82ec1cfa59930b0904;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index dacc726ad5..e62eb80f11 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -65,6 +65,30 @@ Template:inner list * item 1 !! endarticle +!! article +Template:echo +!! text +{{{1}}} +!! endarticle + +!! article +Template:echo_with_span +!! text +{{{1}}} +!! endarticle + +!! article +Template:echo_with_div +!! text +
{{{1}}}
+!! endarticle + +!! article +Template:attr_str +!! text +{{{1}}}="{{{2}}}" +!! endarticle + ### ### Basic tests ### @@ -499,14 +523,30 @@ nowiki 3 ### Comments ### !! test -Comment test 1 +Comments and Pre !! input + asdf + asdf + + asdf +xyz + + asdf + xyz !! result
asdf
 
- +
asdf
+
+
asdf
+
+

xyz +

+
asdf
+xyz
+
!! end !! test @@ -868,6 +908,127 @@ Bug 6200: Preformatted in

!! end +!!test +Templates: Pre: 1a. Templates that break a line should suppress
+!!input
+ {{echo|}}
+!!result
+
+!!end
+
+!!test
+Templates: Pre: 1b. Templates that break a line should suppress 
+!!input
+ {{echo|
+foo}}
+!!result
+

foo +

+!!end + +!! test +Templates: Pre: 1c: Wrapping should be based on expanded content +!! input + {{echo|a +b}} +!!result +
a
+
+

b +

+!!end + +!! test +Templates: Pre: 1d: Wrapping should be based on expanded content +!! input + {{echo|a +b +c + d +e +}} +!!result +
a
+
+

b +c +

+
d
+
+

e +

+!!end + +!!test +Templates: Pre: 1e. Wrapping should be based on expanded content +!!input +{{echo| foo}} + +{{echo| foo}} +{{echo| bar}} + +{{echo| foo}} + +{{echo| foo}} + +{{echo|{{echo| }}bar}} +!!result +
foo
+
+
foo
+bar
+
+
foo
+
+
foo
+
+
bar
+
+!!end + +### +### Parsoid-centric tests for testing RT edge cases +### around comments and white-space inside pre blocks +### + +!!test +1a. Pre and Comments +!!input + a + +c +!!result +
a
+
+

c +

+!!end + +!!test +1b. Pre and Comments +!!input + a + +c +!!result +
a
+
+

c +

+!!end + +!!test +1c. Pre and Comments +!!input + a + + a +!!result +
 a
+
+
 a
+
+!!end ### ### Definition lists @@ -1505,6 +1666,15 @@ second]

!!end +!! test +External links: Pipe char between url and text +!! input +[http://example.com | link] +!! result +

| link +

+!!end + !! test External links: protocol-relative URL in brackets !! input @@ -2816,6 +2986,16 @@ Blah blah blah

!! end +!! test +Parsoid-specific test: Wikilinks with   should RT properly +!! options +language=ln +!! input +[[WW II]] +!!result +

WW II +

+!! end ## ## XHTML tidiness @@ -2852,6 +3032,47 @@ Failing to transform badly formed HTML into correct XHTML

!!end +!! test +Handling html with a div self-closing tag +!! input +
+
+
+
+
+
+!! result +

<div title /> +<div title/> +

+
+

<div title=bar /> +<div title=bar/> +

+
+
+ +!! end + +!! test +Handling html with a br self-closing tag +!! input +
+
+
+
+
+
+!! result +


+
+
+
+
+
+

+!! end + !! test Horizontal ruler (should it add that extra space?) !! input @@ -3843,6 +4064,14 @@ Template parameter as link source

!! end +!!test +Template-generated attribute string (k='v') +!!input +bar +!!result +

bar +

+!!end !!article Template:paramtest2 @@ -4119,6 +4348,47 @@ section=1 ==Section 1== !! end +### +### and in attributes +### +!!test +0. includeonly around the entire attribute +!!input +id="v1"id="v2">bar +!!result +

bar +

+!!end + +!!test +1. includeonly in html attr key +!!input +idabout="foo">bar +!!result +

bar +

+!!end + +!!test +2. includeonly in html attr value +!!input +bar +"v1""v2">bar +!!result +

bar +bar +

+!!end + +!!test +3. includeonly in part of an attr value +!!input +bar +!!result +

bar +

+!!end + ### ### Testing parsing of templates where a template arg ### has the same name as the template itself. @@ -4127,7 +4397,7 @@ section=1 !! article Template:quote !! text -{{{quote|{{{1}}} }}} +{{{quote|{{{1}}}}}} !! endarticle !!test @@ -4135,7 +4405,7 @@ Templates: Template Name/Arg clash: 1. Use of positional param !!input {{quote|foo}} !!result -

foo +

foo

!!end @@ -4153,18 +4423,13 @@ Templates: Template Name/Arg clash: 3. Use of named param with empty input !!input {{quote|quote}} !!result -

quote +

quote

!!end ### ### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged ### -!! article -Template:echo -!! text -{{{1}}} -!! endarticle !!test Templates: 1. Simple use @@ -4456,21 +4721,45 @@ Templates: Tables: 4f. Generating a single tag of a HTML table !!end !!test -Templates: Pre: 1a. Templates that break a line should suppress
+Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)
 !!input
- {{echo|}}
+{{echo|''a}}{{echo|b''c''d}}{{echo|''e}}
 !!result
+

abcde +

+!!end +!!test +Templates: Ugly nesting: 2. Quotes opened/closed across templates (echo_with_span) +(PHP parser generates misnested html) +!! options +disabled +!!input +{{echo_with_span|''a}}{{echo_with_span|b''c''d}}{{echo_with_span|''e}} +!!result +

abcde

!!end !!test -Templates: Pre: 1b. Templates that break a line should suppress
+Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div)
+(PHP parser generates misnested html)
+!! options
+disabled
 !!input
- {{echo|
-foo}}
+{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}}
 !!result
-

foo -

+
a
+
bcd
+
e
+!!end + +!!test +Templates: Ugly nesting: 4. Divs opened/closed across templates +!!input +a
b{{echo|c
d}}e +!!result +a
bc
de + !!end !!test @@ -5151,6 +5440,15 @@ Image with caption !! end +!! test +Image with empty attribute +!! input +[[Image:foobar.jpg|right||Caption text]] +!! result +
Caption text
+ +!! end + !! test Image with link parameter, wiki target !! input @@ -5245,7 +5543,7 @@ Thumbnail image with link parameter !! input [[Image:foobar.jpg|thumb|link=http://example.com/|Title]] !! result -
Title
+
Title
!! end @@ -5319,7 +5617,7 @@ Thumbnail image caption with a free URL !! input [[Image:foobar.jpg|thumb|http://example.com]] !! result - + !! end @@ -5328,7 +5626,7 @@ Thumbnail image caption with a free URL and explicit alt !! input [[Image:foobar.jpg|thumb|http://example.com|alt=Alteration]] !! result - + !! end @@ -5337,7 +5635,7 @@ BUG 1887: A ISBN with a thumbnail !! input [[Image:foobar.jpg|thumb|ISBN 1235467890]] !! result - + !! end @@ -5346,7 +5644,7 @@ BUG 1887: A RFC with a thumbnail !! input [[Image:foobar.jpg|thumb|This is RFC 12354]] !! result -
This is RFC 12354
+
This is RFC 12354
!! end @@ -5355,7 +5653,7 @@ BUG 1887: A mailto link with a thumbnail !! input [[Image:foobar.jpg|thumb|Please mailto:nobody@example.com]] !! result - + !! end @@ -5428,7 +5726,7 @@ Image caption containing another image !! input [[Image:Foobar.jpg|thumb|This is a caption with another [[Image:icon.png|image]] inside it!]] !! result -
This is a caption with another image inside it!
+
This is a caption with another image inside it!
!! end @@ -5448,7 +5746,7 @@ Bug 3090: External links other than http: in image captions !! input [[Image:Foobar.jpg|thumb|200px|This caption has [irc://example.net irc] and [https://example.com Secure] ext links in it.]] !! result -
This caption has irc and Secure ext links in it.
+
This caption has irc and Secure ext links in it.
!! end @@ -5618,6 +5916,39 @@ pst [[Category:Foo (bar)|Foo]] !! end +!! test +Category with template +!! options +cat +pst +!! input +[[Category:{{echo|Foo}}]] +!! result +[[Category:{{echo|Foo}}]] +!! end + +!! test +Category with template in sort key +!! options +cat +pst +!! input +[[Category:Foo|{{echo|Bar}}]] +!! result +[[Category:Foo|{{echo|Bar}}]] +!! end + +!! test +Category with template in sort key and title +!! options +cat +pst +!! input +[[Category:{{echo|Foo}}|{{echo|Bar}}]] +!! result +[[Category:{{echo|Foo}}|{{echo|Bar}}]] +!! end + ### ### Inter-language links ### @@ -5633,6 +5964,19 @@ ill es:Alimento fr:Nourriture zh:食品 !! end +!! test +Duplicate interlanguage links (bug 24502) +!! options +ill +!! input +[[es:1]] +[[es:2]] +[[fr:1]] +[[fr:2]] +!! result +es:1 fr:1 +!! end + ### ### Sections ### @@ -8565,19 +8909,19 @@ image:foobar.jpg|Blabla|alt=This is a foo-bar.|blabla.
  • -
    +

    some caption Main Page

  • -
    Foobar.jpg
    +
    Foobar.jpg
  • -
    This is a foo-bar.
    +
    This is a foo-bar.

    Blabla|blabla.

    @@ -8597,14 +8941,14 @@ File:foobar.jpg|{{Test|unamedParam|alt=param}}|alt=galleryalt !! result