X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=blobdiff_plain;f=tests%2Fparser%2FparserTests.txt;h=751ec4118f1f34b25f2f0a4e1ecb6a27394cc33d;hb=a8448c557df18b6d3744bd5bd6d7a5ed0454443b;hp=e1f2370caa1297b38351935bebf342099ae37fee;hpb=7ab3cef4c0bff4c35338d04b533f55e8e44e0a8b;p=lhc%2Fweb%2Fwiklou.git
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index e1f2370caa..751ec4118f 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -120,12 +120,31 @@ Template:table_attribs
|style="color: red"| Foo
!! endarticle
+!! article
+Template:table_cells
+!! text
+{{table_attribs}} || Bar || Baz
+!! endarticle
+
+!! article
+Template:image_attribs
+!! text
+
a -
b +b +
+a +b
a @@ -269,7 +296,7 @@ a b ---- a - + b ---- a @@ -292,7 +319,7 @@ b
a -
b +b
a @@ -852,6 +879,74 @@ Non-html5 tags should be accepted
!! end +!! test +strike
+
s
+
<bâ> doesn't work! </b> +
<bä> doesn't work! </b> +
<boo> works fine </b> +
<s.foo>foo</s> +
<s.foo>s.foo</s.foo> +
<sub-ID#1> +
+!! end + +### +### Special characters +### + +!! test +Bare pipe character (bug 52363) +!! input +| +!! result +| +
+!! end + +!! test +Bare pipe character from a template (bug 52363) +!! input +{{pipe}} +!! result +| +
+!! end + ### ###This is not + preformatted text. +
+This is preformatted text. + So is this. ++!! end + !! test Ident preformatting with inline content !! input @@ -1661,6 +1772,20 @@ c !!end +!!test +1d. Indent-Pre and Comments +(Pre-handler currently cannot distinguish between comment/ws order and normalizes them to [comment,ws] order) +!!input + a + + b +!!result +
a ++
b ++!!end + !!test 2a. Indent-Pre and tables !!input @@ -1813,6 +1938,52 @@ b !! end +!! test +6. Pre-blocks should extend across lines with leading WS even when there is no wrappable content +!! input + a + + + b + + c + +d +!! result +
a + +b ++
c + ++
d +
+!! end + +!! test +7a. Indent-pre and category links +!! options +parsoid=wt2html,wt2wt +!! input + [[Category:foo]] +{{echo| [[Category:foo]]}} +!! result + +!! end + +!! test +7b. Indent-pre and category links +!! options +parsoid=wt2html,wt2wt +!! input + [[Category:foo]] a + [[Category:foo]] {{echo|b}} +!! result + a b
+
+!! end
+
###
### HTML-pre (some to spec PHP parser behavior and some Parsoid-RT-centric)
###
@@ -3855,6 +4026,36 @@ Template-generated table cell attributes and cell content
!! end
+!! test
+Template-generated table cell attributes and cell content (2)
+!! input
+{|
+|align=center {{table_attribs}}
+|}
+!! result
+Foo + |
Foo | +Bar | +Baz + |
1 +
+!! end + !! test Magic Word: {{CURRENTMONTHABBREV}} !! input @@ -5486,6 +5803,15 @@ Magic Word: {{CURRENTTIME}} !! end +!! test +Magic Word: {{CURRENTHOUR}} +!! input +{{CURRENTHOUR}} +!! result +00 +
+!! end + !! test Magic Word: {{CURRENTWEEK}} (@bug 4594) !! input @@ -5504,6 +5830,51 @@ Magic Word: {{CURRENTYEAR}} !! end +!! test +Magic Word: {{CURRENTTIMESTAMP}} +!! input +{{CURRENTTIMESTAMP}} +!! result +19700101000203 +
+!! end + +!! test +Magic Words LOCAL (UTC) +!! input +* {{LOCALMONTH}} +* {{LOCALMONTH1}} +* {{LOCALMONTHNAME}} +* {{LOCALMONTHNAMEGEN}} +* {{LOCALMONTHABBREV}} +* {{LOCALDAY}} +* {{LOCALDAY2}} +* {{LOCALDAYNAME}} +* {{LOCALYEAR}} +* {{LOCALTIME}} +* {{LOCALHOUR}} +* {{LOCALWEEK}} +* {{LOCALDOW}} +* {{LOCALTIMESTAMP}} +!! result +User talk +
+!! end + +!! test +Magic Word: {{TALKSPACE}}, same namespace +!! options +title=[[User talk:Ãvar Arnfjörð Bjarmason]] +!! input +{{TALKSPACE}} +!! result +User talk +
+!! end + +!! test +Magic Word: {{TALKSPACE}}, main namespace +!! options +title=[[Parser Test]] +!! input +{{TALKSPACE}} +!! result +Talk +
+!! end + +!! test +Magic Word: {{TALKSPACEE}} +!! options +title=[[User:Ãvar Arnfjörð Bjarmason]] +!! input +{{TALKSPACEE}} +!! result +User_talk +
+!! end + +!! test +Magic Word: {{SUBJECTSPACE}} +!! options +title=[[User talk:Ãvar Arnfjörð Bjarmason]] +!! input +{{SUBJECTSPACE}} +!! result +User +
+!! end + +!! test +Magic Word: {{SUBJECTSPACE}}, same namespace +!! options +title=[[User:Ãvar Arnfjörð Bjarmason]] +!! input +{{SUBJECTSPACE}} +!! result +User +
+!! end + +!! test +Magic Word: {{SUBJECTSPACE}}, main namespace +!! options +title=[[Parser Test]] +!! input +{{SUBJECTSPACE}} +!! result + +!! end + +!! test +Magic Word: {{SUBJECTSPACEE}} +!! options +title=[[User talk:Ãvar Arnfjörð Bjarmason]] +!! input +{{SUBJECTSPACEE}} +!! result +User +
+!! end + !! test Magic Word: {{NAMESPACE}} !! options @@ -5559,6 +6017,116 @@ title=[[User:Ãvar Arnfjörð Bjarmason]] !! end +!! test +Magic Word: {{SUBPAGENAME}} +!! options +title=[[Ãvar Arnfjörð Bjarmason/sub ö]] subpage +!! input +{{SUBPAGENAME}} +!! result +sub ö +
+!! end + +!! test +Magic Word: {{SUBPAGENAMEE}} +!! options +title=[[Ãvar Arnfjörð Bjarmason/sub ö]] subpage +!! input +{{SUBPAGENAMEE}} +!! result +sub_%C3%B6 +
+!! end + +!! test +Magic Word: {{ROOTPAGENAME}} +!! options +title=[[Ãvar Arnfjörð Bjarmason/sub/sub2]] subpage +!! input +{{ROOTPAGENAME}} +!! result +Ãvar Arnfjörð Bjarmason +
+!! end + +!! test +Magic Word: {{ROOTPAGENAMEE}} +!! options +title=[[Ãvar Arnfjörð Bjarmason/sub/sub2]] subpage +!! input +{{ROOTPAGENAMEE}} +!! result +%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason +
+!! end + +!! test +Magic Word: {{BASEPAGENAME}} +!! options +title=[[Ãvar Arnfjörð Bjarmason/sub]] subpage +!! input +{{BASEPAGENAME}} +!! result +Ãvar Arnfjörð Bjarmason +
+!! end + +!! test +Magic Word: {{BASEPAGENAMEE}} +!! options +title=[[Ãvar Arnfjörð Bjarmason/sub]] subpage +!! input +{{BASEPAGENAMEE}} +!! result +%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason +
+!! end + +!! test +Magic Word: {{TALKPAGENAME}} +!! options +title=[[User:Ãvar Arnfjörð Bjarmason]] +!! input +{{TALKPAGENAME}} +!! result +User talk:Ãvar Arnfjörð Bjarmason +
+!! end + +!! test +Magic Word: {{TALKPAGENAMEE}} +!! options +title=[[User:Ãvar Arnfjörð Bjarmason]] +!! input +{{TALKPAGENAMEE}} +!! result +User_talk:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason +
+!! end + +!! test +Magic Word: {{SUBJECTPAGENAME}} +!! options +title=[[User talk:Ãvar Arnfjörð Bjarmason]] +!! input +{{SUBJECTPAGENAME}} +!! result +User:Ãvar Arnfjörð Bjarmason +
+!! end + +!! test +Magic Word: {{SUBJECTPAGENAMEE}} +!! options +title=[[User talk:Ãvar Arnfjörð Bjarmason]] +!! input +{{SUBJECTPAGENAMEE}} +!! result +User:%C3%86var_Arnfj%C3%B6r%C3%B0_Bjarmason +
+!! end + !! test Magic Word: {{NUMBEROFFILES}} !! input @@ -5641,6 +6209,15 @@ Magic Word: {{SCRIPTPATH}} !! end +!! test +Magic Word: {{STYLEPATH}} +!! input +{{STYLEPATH}} +!! result +/skins +
+!! end + !! test Magic Word: {{SERVER}} !! input @@ -6491,6 +7068,34 @@ Un-closedab
+cd
+a
+b
+!! end + ### ###<div>[[foo]]
+ab
+cd
+ef
+!! end + +!! test +Parsoid: Recognize nowiki with odd capitalization +!! options +parsoid=wt2html +!! input +<div>[[foo]]
+!! end + + +!! test +Parsoid: Escape nowiki with trailing space in tags +!! options +parsoid=html2wt +!! input +<nowiki > foo </nowiki > + +a<nowiki />b + +c<nowiki/ >d +!! result +<nowiki > foo </nowiki >
+a<nowiki />b
+c<nowiki/ >d
+!! end + +!! test +Parsoid: Escape weird noWikI capitalizations +!! options +parsoid=html2wt +!! input +<noWikI > foo </NoWikI > +!! result +<noWikI > foo </NoWikI >
+!! end + ### ### Message transform tests ### @@ -7800,8 +8461,13 @@ Special:Foobar_nonexistent ### ### Images ### +### For Parsoid-specific tests, see +#### http://www.mediawiki.org/wiki/Parsoid/MediaWiki_DOM_spec#Images + !! test -Simple image +Simple image (php) +!! options +php !! input [[Image:foobar.jpg]] !! result @@ -7810,16 +8476,20 @@ Simple image !! end !! test -Right-aligned image +Simple image (parsoid) +!! options +parsoid=wt2html !! input -[[Image:foobar.jpg|right]] +[[Image:foobar.jpg]] !! result - - + !! end !! test -Simple image (using File: namespace, now canonical) +Simple image (using File: namespace, now canonical) (php) +!! options +php !! input [[File:foobar.jpg]] !! result @@ -7828,29 +8498,108 @@ Simple image (using File: namespace, now canonical) !! end !! test -Image with caption +Simple image (using File: namespace, now canonical) (parsoid) +!! options +parsoid +!! input +[[File:Foobar.jpg]] +!! result + +!! end + +!! test +Right-aligned image (php) +!! options +php +!! input +[[Image:foobar.jpg|right]] +!! result + + +!! end + +!! test +Right-aligned image (parsoid) +!! options +parsoid +!! input +[[File:Foobar.jpg|right]] +!! result +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
#
#
-# ||||
300px| centre
caption
bar|baz
++bar
+-bar 'foo'
''foo''
@@ -15713,7 +16584,12 @@ parsoid
'''foo'''
foo'bar'baz
foo's
- 'bar'
+'bar'
+ <nowiki>foo</nowiki>
foo's bar : 123 456
+#
#
#abc
#
@@ -10088,7 +10916,7 @@ Expansion of multi-line templates in attribute values (bug 6255 sanity check 2)
!! end
###
-### Parser hooks (see maintenance/parserTestsParserHook.php for the
+
+
+
+
+
+
+
+
+
@@ -14935,7 +15765,7 @@ This should just get lost.
-
+
!!end
!!test
@@ -14948,6 +15778,29 @@ parsoid
!!end
+!! test
+References: 7. Multiple references tags (one without and one with nested refs) should be correctly handled
+!! options
+parsoid
+!! input
+A foo bar for a
+B
+
+
+
+!! end
+
#### ----------------------------------------------------------------
#### The following section of tests are primarily to test
#### wikitext escaping capabilities of Parsoid. Given that
@@ -15574,11 +16427,20 @@ parsoid
|-
|''foo''-bar
|''foo''+bar
+|-
+|foo
+bar|baz
++bar
+-bar
|}
!! result
!! end
@@ -15690,19 +16552,28 @@ parsoid
#### 1. Quotes inside and
#### 2. Link fragments separated by and tags
#### 3. Link fragments inside and
+#### 4. No escaping needed
#### --------------------------------------
!! test
1. Quotes inside and
+!! options
+parsoid=html2wt,wt2wt
!! input
''foo-bar foo+bar
+foo-bar foo+bar foo
+