Merge "Add a test for named vs. positional parameter whitespace stripping"
authorSubramanya Sastry <ssastry@wikimedia.org>
Thu, 8 Nov 2012 22:43:47 +0000 (22:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 8 Nov 2012 22:43:47 +0000 (22:43 +0000)
1  2 
tests/parser/parserTests.txt

@@@ -95,13 -95,6 +95,13 @@@ Template:attr_st
  {{{1}}}="{{{2}}}"
  !! endarticle
  
 +!! article
 +Template:table_attribs
 +!! text
 +<noinclude>
 +|</noinclude>style="color: red"| Foo
 +!! endarticle
 +
  ###
  ### Basic tests
  ###
@@@ -1049,27 -1042,34 +1049,55 @@@ Templates: Pre: 1f: Wrapping should be 
  </pre>
  !!end
  
 +!! test
 +Templates: Single-line variant of parameter whitespace stripping test
 +!! input
 +{{echo| a}}
 +
 +{{echo|1= a}}
 +
 +{{echo|{{echo| a}}}}
 +
 +{{echo|1={{echo| a}}}}
 +!! result
 +<pre>a
 +</pre>
 +<p>a
 +</p>
 +<pre>a
 +</pre>
 +<p>a
 +</p>
 +!! end
 +
+ !! test
+ Templates: Strip whitespace from named parameters, but not positional ones
+ !! input
+ {{echo|
+  foo}}
+ {{echo|
+ * foo}}
+ {{echo| 1 =
+  foo}}
+ {{echo| 1 =
+ * foo}}
+ !! result
+ <pre>foo
+ </pre>
+ <p><br />
+ </p>
+ <ul><li> foo
+ </li></ul>
+ <p>foo
+ </p>
+ <ul><li> foo
+ </li></ul>
+ !! end
  ###
  ### Parsoid-centric tests for testing RT edge cases for pre
  ###
@@@ -2753,19 -2753,6 +2781,19 @@@ Indented table markup mixed with indent
  
  !! end
  
 +!! test
 +Template-generated table cell attributes and cell content
 +!! input
 +{|
 +|{{table_attribs}}
 +|}
 +!! result
 +<table>
 +<tr>
 +<td style="color: red"> Foo
 +</td></tr></table>
 +
 +!! end
  
  ###
  ### Internal links