Added ugly nesting and template interaction tests (to stress Parsoid).
authorSubramanya Sastry <ssastry@wikimedia.org>
Mon, 15 Oct 2012 17:01:54 +0000 (12:01 -0500)
committerSubramanya Sastry <ssastry@wikimedia.org>
Mon, 15 Oct 2012 17:01:54 +0000 (12:01 -0500)
Change-Id: I244f682b458626e827888aa7eed0fb6ad26a9d97

tests/parser/parserTests.txt

index 826df81..e62eb80 100644 (file)
@@ -71,6 +71,18 @@ Template:echo
 {{{1}}}
 !! endarticle
 
+!! article
+Template:echo_with_span
+!! text
+<span>{{{1}}}</span>
+!! endarticle
+
+!! article
+Template:echo_with_div
+!! text
+<div>{{{1}}}</div>
+!! endarticle
+
 !! article
 Template:attr_str
 !! text
@@ -4708,6 +4720,48 @@ Templates: Tables: 4f. Generating a single tag of a HTML table
 
 !!end
 
+!!test
+Templates: Ugly nesting: 1. Quotes opened/closed across templates (echo)
+!!input
+{{echo|''a}}{{echo|b''c''d}}{{echo|''e}}
+!!result
+<p><i>ab</i>c<i>d</i>e
+</p>
+!!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
+<p><span><i>a</i></span><i><span>b</span></i><span>c</span><i>d</i><span>e</span></p>
+!!end
+
+!!test
+Templates: Ugly nesting: 3. Quotes opened/closed across templates (echo_with_div)
+(PHP parser generates misnested html)
+!! options
+disabled
+!!input
+{{echo_with_div|''a}}{{echo_with_div|b''c''d}}{{echo_with_div|''e}}
+!!result
+<div><i>a</i></div>
+<div><i>b</i>c<i>d</i></div>
+<div>e</div>
+!!end
+
+!!test
+Templates: Ugly nesting: 4. Divs opened/closed across templates
+!!input
+a<div>b{{echo|c</div>d}}e
+!!result
+a<div>bc</div>de
+
+!!end
+
 !!test
 Parser Functions: 1. Simple example
 !!input