New tests to check handling of tpl-name and tplarg-name clashes.
authorSubramanya Sastry <ssastry@wikimedia.org>
Wed, 26 Sep 2012 18:58:30 +0000 (13:58 -0500)
committerSubramanya Sastry <ssastry@wikimedia.org>
Wed, 26 Sep 2012 19:12:42 +0000 (14:12 -0500)
Change-Id: I99180af6460b8925a64b751650aaae6163e4ac27

tests/parser/parserTests.txt

index fea9296..b3b9262 100644 (file)
@@ -4119,6 +4119,44 @@ section=1
 ==Section 1==
 !! end
 
+###
+### Testing parsing of templates where a template arg
+### has the same name as the template itself.
+###
+
+!! article
+Template:quote
+!! text
+{{{quote|{{{1}}} }}}
+!! endarticle
+
+!!test
+Templates: Template Name/Arg clash: 1. Use of positional param
+!!input
+{{quote|foo}}
+!!result
+<p>foo 
+</p>
+!!end
+
+!!test
+Templates: Template Name/Arg clash: 2. Use of named param
+!!input
+{{quote|quote=foo}}
+!!result
+<p>foo
+</p>
+!!end
+
+!!test
+Templates: Template Name/Arg clash: 3. Use of named param with empty input
+!!input
+{{quote|quote}}
+!!result
+<p>quote 
+</p>
+!!end
+
 ###
 ### Parsoid-centric tests to stress Parsoid's ability to RT them unchanged
 ###