From: C. Scott Ananian
Date: Tue, 9 Jul 2013 18:20:38 +0000 (-0400)
Subject: Sync up with Parsoid tests.
X-Git-Tag: 1.31.0-rc.0~19232
X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=1f2f556496d668d2be7341e46f79fcc1790da71d;p=lhc%2Fweb%2Fwiklou.git
Sync up with Parsoid tests.
This now aligns with Parsoid commit 0849c09195a0ada3d108f40c17924004c133f906.
Change-Id: I5a60d4994e12b1b34f390e69606fc564b3282166
---
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 09e1c7c37a..ce5e9f80f8 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -810,6 +810,23 @@ The ''[[Main Page]]'''s talk page.
!! end
+!! test
+Parsoid only: Quote balancing context should be restricted to td/th cells on the same wikitext line
+(Requires tidy for PHP parser output to be fixed up)
+!! options
+parsoid=wt2html,wt2wt
+!! input
+{|
+!''a!!''b
+|''a||''b
+|}
+!! result
+
+
a
b
+
a
b
+
+!! end
+
###
### Non-html5 tags
###
@@ -898,6 +915,16 @@ Entities inside
!! end
+!! test
+Entities inside template parameters
+!! options
+parsoid
+!! input
+{{echo|–}}
+!! result
+
–
+
+!! end
###
### Comments
@@ -1515,6 +1542,17 @@ Templates: Strip whitespace from named parameters, but not positional ones
!! end
+!! test
+Templates: Dont strip whitespace from whitespace/comment-only arguments
+!! input
+{{echo| }}
+{{echo|}}
+{{echo| }}
+!! result
+
+
+!! end
+
!! test
Templates: Parsoid parameter escaping test 1
!! options
@@ -1525,6 +1563,52 @@ parsoid
[foo]
!! end
+
+!! test
+Parsoid: Pipes in external links in template parameter
+!! options
+parsoid
+!! input
+{{echo|[{{echo|http://example.com}} link]}}
+!! result
+
+!! end
+
+!! test
+Parsoid: Pipe in external link target and content in template parameter
+!! options
+parsoid=html2wt,wt2wt
+!! input
+{{echo|[http://foo.com/a|b a|b]}}
+!! result
+
+!! end
+
+!! test
+Templates: Dont escape already nowiki-escaped text in template parameters
+!! options
+parsoid=html2wt,wt2wt
+!! input
+{{echo|foo|bar}}
+!! result
+
foo|bar
+!! end
+
###
### Parsoid-centric tests for testing RT edge cases for pre
###
@@ -3170,6 +3254,28 @@ Non-extlinks in brackets
!! end
+!! test
+Parsoid: Percent encoding in external links
+!! options
+parsoid
+!! input
+[https://github.com/search?l=&q=ResourceLoader+%40wikimedia Search]
+!! result
+
+!! end
+
+!! test
+Parsoid: use url link syntax for links where the content is equal the link
+target
+!! options
+parsoid
+!! input
+http://example.com
+!! result
+
+!! end
+
###
### Quotes
###
@@ -3275,7 +3381,7 @@ Plain ''italic'''s plain
###
# This should not produce
as
-# is the bare minimun required by the spec, see:
+# is the bare minimum required by the spec, see:
# http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables
!! test
A table with no data. (php)
@@ -3860,6 +3966,62 @@ parsoid
foo
!! end
+!! test
+Implicit
after a |-
+(PHP parser relies on Tidy to add the missing
+!! end
+
###
### Internal links
###
@@ -5184,6 +5346,23 @@ parsoid=wt2html,wt2wt
!!end
+
+!! test
+Parsoid: Make sure nested lists are serialized on their own line even if HTML contains no newlines
+!! options
+parsoid
+!! input
+# foo
+## bar
+* foo
+** bar
+: foo
+:: bar
+!! result
+
foo
bar
foo
bar
foo
bar
+!! end
+
+
###
### Magic Words
###
@@ -6683,6 +6862,20 @@ Templates: HTML Tables: 4f. Generating a single tag of a HTML table
!!end
+!!test
+Templates: HTML Tables: 5. Proper fostering of categories from inside
+!!options
+parsoid=wt2html,wt2wt
+!!input
+
[[Category:foo1]]
foo
+
+
[[Category:bar1]][[Category:bar2]]
foo
+!!result
+
foo
+
+
foo
+!!end
+
!!test
Templates: Wiki Tables: 1a. Fostering of entire template content
!!input
@@ -8335,6 +8528,38 @@ subpage title=[[Subpage test]]
!! end
+# TODO: make this PHP-parser compatible!
+!! test
+Relative subpage noslash link
+!! options
+parsoid=wt2wt,wt2html,html2html
+subpage title=[[Subpage test/1/2/3/4]]
+!!input
+[[../../subpage/]]
+
+[[../../subpage]]
+!! result
+
+!! end
+
!! test
Disabled subpages
!! input
@@ -14584,6 +14809,16 @@ B foo\nThis should just get lost."},"attrs":{}}' typeof="mw:Extension/references">
!!end
+!!test
+References: 6. from a transclusion
+!!options
+parsoid
+!!input
+{{echo|}}
+!!result
+
+!!end
+
#### ----------------------------------------------------------------
#### The following section of tests are primarily to test
#### wikitext escaping capabilities of Parsoid. Given that
@@ -15463,6 +15698,15 @@ parsoid
!! end
+!! test
+4. extension tags
+!! input
+foo
+!! result
+
<ref>foo</ref>
+
+!! end
+
#### --------------- Others ---------------
!! test
Escaping nowikis
@@ -15831,6 +16075,52 @@ parsoid
!!end
+# -----------------------------------------------------------------
+# The following section of tests are primarily to spec requirements
+# around serialization of new/edited content.
+#
+# All these tests are marked Parsoid html2wt and html2html only
+# ----------------------------------------------------------------
+
+!! test
+Image: Modifying size of an image
+!! options
+parsoid=html2wt
+!! input
+[[Image:Wiki.png|230x230px]]
+!! result
+
+!!end
+
+!! test
+Image: New block level image should have \n before and after
+!! options
+parsoid=html2wt
+!! input
+123
+[[File:Wiki.png|right|thumb|150x150px]]
+456
+!! result
+
123
456
+!!end
+
+!! test
+Lists: Add space after bullets
+!! options
+parsoid=html2wt
+!! input
+
+* foo
+* bar
+* baz
+!! result
+