From: Subramanya Sastry Date: Tue, 25 Sep 2012 18:39:44 +0000 (-0500) Subject: Added several template tests to stress Parsoid template RT-ing. X-Git-Tag: 1.31.0-rc.0~22278^2 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=5ff95b07e21eaa96cafdb01814fd53f698beb195;p=lhc%2Fweb%2Fwiklou.git Added several template tests to stress Parsoid template RT-ing. Change-Id: I294e5566b00bba260046f403b247d4d5d169b14f --- diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 43d42715c3..0c767c7ee1 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -4119,6 +4119,340 @@ section=1 ==Section 1== !! end +### +### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged +### +!! article +Template:echo +!! text +{{{1}}} +!! endarticle + +!!test +Templates: 1. Simple use +!!input +{{echo|Foo}} +!!result +

Foo +

+!!end + +!!test +Templates: 2. Inside a block tag +!!input +
{{echo|Foo}}
+!!result +
Foo
+ +!!end + +!!test +Templates: P-wrapping: 1a. Templates on consecutive lines +!!input +{{echo|Foo}} +{{echo|bar}} +!!result +

Foo +bar +

+!!end + +!!test +Templates: P-wrapping: 1b. Templates on consecutive lines +!!input +Foo + +{{echo|bar}} +{{echo|baz}} +!!result +

Foo +

bar +baz +

+!!end + +!!test +Templates: P-wrapping: 1c. Templates on consecutive lines +!!input +{{echo|Foo}} +{{echo|bar}}
baz
+!!result +

Foo +

+bar
baz
+ +!!end + +!!test +Templates: Inline Text: 1. Multiple tmeplate uses +!!input +{{echo|Foo}}bar{{echo|baz}} +!!result +

Foobarbaz +

+!!end + +!!test +Templates: Inline Text: 2. Back-to-back template uses +!!input +{{echo|Foo}}{{echo|bar}} +!!result +

Foobar +

+!!end + +!!test +Templates: Block Tags: 1. Multiple template uses +!!input +{{echo|
Foo
}}
bar
{{echo|
baz
}} +!!result +
Foo
bar
baz
+ +!!end + +!!test +Templates: Block Tags: 2. Back-to-back template uses +!!input +{{echo|
Foo
}}{{echo|
bar
}} +!!result +
Foo
bar
+ +!!end + +!!test +Templates: Links: 1. Simple example +!!input +{{echo|[[Foo|bar]]}} +!!result +

bar +

+!!end + +!!test +Templates: Links: 2. Generation of link href +!!input +[[{{echo|Foo}}|bar]] +!!result +

bar +

+!!end + +!!test +Templates: Links: 3. Generation of part of a link href +!!input +[[Fo{{echo|o}}|bar]] +!!result +

bar +

+!!end + +!!test +Templates: Links: 4. Multiple templates generating link href +!!input +[[{{echo|F}}{{echo|o}}ob{{echo|ar}}]] +!!result +

Foobar +

+!!end + +!!test +Templates: Links: 5. Generation of link text +!!input +[[Foo|{{echo|bar}}]] +!!result +

bar +

+!!end + +!!test +Templates: Links: 5. Nested templates (only outermost template should be marked) +!!input +{{echo|[[{{echo|Foo}}|bar]]}} +!!result +

bar +

+!!end + +!!test +Templates: HTML Tag: 1. Generation of HTML attr. key +!!input +
foo
+!!result +
foo
+ +!!end + +!!test +Templates: HTML Tag: 2. Generation of HTML attr. value +!!input +
foo
+!!result +
foo
+ +!!end + +!!test +Templates: HTML Tag: 3. Generation of HTML attr key and value +!!input +
foo
+!!result +
foo
+ +!!end + +!!test +Templates: HTML Tag: 4. Generation of starting piece of HTML attr value +!!input +
foo
+!!result +
foo
+ +!!end + +!!test +Templates: HTML Tag: 5. Generation of middle piece of HTML attr value +!!input +
foo
+!!result +
foo
+ +!!end + +!!test +Templates: HTML Tag: 6. Generation of end piece of HTML attr value +!!input +
foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 1. Generating start of a HTML table +!!input +{{echo|}}
foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 2a. Generating middle of a HTML table +!!input +{{echo|}}
foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 2b. Generating middle of a HTML table +!!input +{{echo|}}
foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 3. Generating end of a HTML table +!!input +{{echo|
foo
}} +!!result +
foo
+ +!!end + +!!test +Templates: Tables: 4a. Generating a single tag of a HTML table +!!input +{{echo|}}
foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 4b. Generating a single tag of a HTML table +!!input +{{echo|}}
foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 4c. Generating a single tag of a HTML table +!!input +{{echo|
}}foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 4d. Generating a single tag of a HTML table +!!input +}}
foo{{echo|
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 4e. Generating a single tag of a HTML table +!!input +{{echo|}}
foo
+!!result +
foo
+ +!!end + +!!test +Templates: Tables: 4f. Generating a single tag of a HTML table +!!input +{{echo|
foo
}} +!!result +
foo
+ +!!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 +Parser Functions: 1. Simple example +!!input +{{uc:foo}} +!!result +

FOO +

+!!end + +!!test +Parser Functions: 2. Nested use (only outermost should be marked up) +!!input +{{uc:{{lc:FOO}}}} +!!result +

FOO +

+!!end + ### ### Pre-save transform tests ###