Parsoid-centric tests to RT-test comments-ws-pre interactions.
[lhc/web/wiklou.git] / tests / parser / parserTests.txt
index 0ba21d9..f555d4f 100644 (file)
@@ -65,6 +65,12 @@ Template:inner list
 * item 1
 !! endarticle
 
+!! article
+Template:echo
+!! text
+{{{1}}}
+!! endarticle
+
 ###
 ### Basic tests
 ###
@@ -499,14 +505,30 @@ nowiki 3
 ### Comments
 ###
 !! test
-Comment test 1
+Comments and Pre
 !! input
+<!-- comment 1 --> asdf
+
 <!-- comment 1 --> asdf
 <!-- comment 2 -->
+
+<!-- comment 1 --> asdf
+<!-- comment 2 -->xyz
+
+<!-- comment 1 --> asdf
+<!-- comment 2 --> xyz
 !! result
 <pre>asdf
 </pre>
-
+<pre>asdf
+</pre>
+<pre>asdf
+</pre>
+<p>xyz
+</p>
+<pre>asdf
+xyz
+</pre>
 !! end
 
 !! test
@@ -868,6 +890,127 @@ Bug 6200: Preformatted in <blockquote>
 </p>
 !! end
 
+!!test
+Templates: Pre: 1a. Templates that break a line should suppress <pre>
+!!input
+ {{echo|}}
+!!result
+
+!!end
+
+!!test
+Templates: Pre: 1b. Templates that break a line should suppress <pre>
+!!input
+ {{echo|
+foo}}
+!!result
+<p>foo
+</p>
+!!end
+
+!! test
+Templates: Pre: 1c: Wrapping should be based on expanded content
+!! input
+ {{echo|a
+b}}
+!!result
+<pre>a
+</pre>
+<p>b
+</p>
+!!end
+
+!! test
+Templates: Pre: 1d: Wrapping should be based on expanded content
+!! input
+ {{echo|a
+b
+c
+ d
+e
+}}
+!!result
+<pre>a
+</pre>
+<p>b
+c
+</p>
+<pre>d
+</pre>
+<p>e
+</p>
+!!end
+
+!!test
+Templates: Pre: 1e. Wrapping should be based on expanded content
+!!input
+{{echo| foo}}
+
+{{echo| foo}}
+{{echo| bar}}
+
+{{echo|<!--cmt--> foo}}
+
+<!--cmt-->{{echo| foo}}
+
+{{echo|{{echo| }}bar}}
+!!result
+<pre>foo
+</pre>
+<pre>foo
+bar
+</pre>
+<pre>foo
+</pre>
+<pre>foo
+</pre>
+<pre>bar
+</pre>
+!!end
+
+###
+### Parsoid-centric tests for testing RT edge cases
+### around comments and white-space inside pre blocks
+###
+
+!!test
+1a. Pre and Comments
+!!input
+ a
+<!--a-->
+c
+!!result
+<pre>a
+</pre>
+<p>c
+</p>
+!!end
+
+!!test
+1b. Pre and Comments
+!!input
+ a
+ <!--a-->
+c
+!!result
+<pre>a
+</pre>
+<p>c
+</p>
+!!end
+
+!!test
+1c. Pre and Comments
+!!input
+<!--a-->  a
+
+ <!--a--> a
+!!result
+<pre> a
+</pre>
+<pre> a
+</pre>
+!!end
 
 ###
 ### Definition lists
@@ -1505,6 +1648,15 @@ second]
 </p>
 !!end
 
+!! test
+External links: Pipe char between url and text
+!! input
+[http://example.com | link]
+!! result
+<p><a rel="nofollow" class="external text" href="http://example.com">| link</a>
+</p>
+!!end
+
 !! test
 External links: protocol-relative URL in brackets
 !! input
@@ -2816,6 +2968,16 @@ Blah blah blah
 </p>
 !! end
 
+!! test
+Parsoid-specific test: Wikilinks with &nbsp; should RT properly
+!! options
+language=ln
+!! input
+[[WW&nbsp;II]]
+!!result
+<p><a href="/index.php?title=WW_II&amp;action=edit&amp;redlink=1" class="new" title="WW II (lonkásá  ezalí tɛ̂)">WW&#160;II</a>
+</p>
+!! end
 
 ##
 ## XHTML tidiness
@@ -4168,7 +4330,7 @@ section=1
 !! article
 Template:quote
 !! text
-{{{quote|{{{1}}} }}}
+{{{quote|{{{1}}}}}}
 !! endarticle
 
 !!test
@@ -4176,7 +4338,7 @@ Templates: Template Name/Arg clash: 1. Use of positional param
 !!input
 {{quote|foo}}
 !!result
-<p>foo 
+<p>foo
 </p>
 !!end
 
@@ -4194,18 +4356,13 @@ Templates: Template Name/Arg clash: 3. Use of named param with empty input
 !!input
 {{quote|quote}}
 !!result
-<p>quote 
+<p>quote
 </p>
 !!end
 
 ###
 ### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged
 ###
-!! article
-Template:echo
-!! text
-{{{1}}}
-!! endarticle
 
 !!test
 Templates: 1. Simple use
@@ -4496,24 +4653,6 @@ Templates: Tables: 4f. Generating a single tag of a HTML table
 
 !!end
 
-!!test
-Templates: Pre: 1a. Templates that break a line should suppress <pre>
-!!input
- {{echo|}}
-!!result
-
-!!end
-
-!!test
-Templates: Pre: 1b. Templates that break a line should suppress <pre>
-!!input
- {{echo|
-foo}}
-!!result
-<p>foo
-</p>
-!!end
-
 !!test
 Parser Functions: 1. Simple example
 !!input