r83894 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83893‎ | r83894 | r83895 >
Date:13:55, 14 March 2011
Author:catrope
Status:ok
Tags:
Comment:
Per Nikerabbit, add some minifier tests for historic failure cases that I had lying around
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/libs/JavaScriptMinifierTest.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/libs/JavaScriptMinifierTest.php
@@ -57,7 +57,20 @@
5858 array( "x:{}/ x/g", "x:{}/ x/g" ),
5959 array( "switch(x){case y?z:{}/ x/g:{}/ x/g;}", "switch(x){case y?z:{}/x/g:{}/ x/g;}" ),
6060 array( "function x(){}/ x/g", "function x(){}/ x/g" ),
61 - array( "+function x(){}/ x/g", "+function x(){}/x/g" )
 61+ array( "+function x(){}/ x/g", "+function x(){}/x/g" ),
 62+
 63+ // Tests for things that broke in the past
 64+ // Multiline quoted string
 65+ array( "var foo=\"\\\nblah\\\n\";", "var foo=\"\\\nblah\\\n\";" ),
 66+ // Multiline quoted string followed by string with spaces
 67+ array( "var foo=\"\\\nblah\\\n\";\nvar baz = \" foo \";\n", "var foo=\"\\\nblah\\\n\";var baz=\" foo \";" ),
 68+ // URL in quoted string ( // is not a comment)
 69+ array( "aNode.setAttribute('href','http://foo.bar.org/baz');", "aNode.setAttribute('href','http://foo.bar.org/baz');" ),
 70+ // URL in quoted string after multiline quoted string
 71+ array( "var foo=\"\\\nblah\\\n\";\naNode.setAttribute('href','http://foo.bar.org/baz');", "var foo=\"\\\nblah\\\n\";aNode.setAttribute('href','http://foo.bar.org/baz');" ),
 72+ // Division vs. regex nastiness
 73+ array( "alert( (10+10) / '/'.charCodeAt( 0 ) + '//' );", "alert((10+10)/'/'.charCodeAt(0)+'//');" ),
 74+ array( "if(1)/a /g.exec('Pa ss');", "if(1)/a /g.exec('Pa ss');" ),
6275 );
6376 }
6477

Status & tagging log