From: Timo Tijhof Date: Sat, 11 Aug 2018 23:24:10 +0000 (+0100) Subject: JavaScriptMinifier: Move test case for 'x++' to provideLineBreaker() X-Git-Tag: 1.34.0-rc.0~4476^2~1 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=da3aa28cea9fa26a21e5478f89d71347010c6b9f;p=lhc%2Fweb%2Fwiklou.git JavaScriptMinifier: Move test case for 'x++' to provideLineBreaker() Easier to read. Bug: T201606 Change-Id: Ie12910edf5ab6a9d7246000ca78a3c9208aeb152 --- diff --git a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php index 3e37f15a9f..ce8bb06abc 100644 --- a/tests/phpunit/includes/libs/JavaScriptMinifierTest.php +++ b/tests/phpunit/includes/libs/JavaScriptMinifierTest.php @@ -165,9 +165,6 @@ class JavaScriptMinifierTest extends PHPUnit\Framework\TestCase { ], [ "if(1)/a /g.exec('Pa ss');", "if(1)/a /g.exec('Pa ss');" ], - // newline insertion after 1000 chars: break after the "++", not before - [ str_repeat( ';', 996 ) . "if(x++);", str_repeat( ';', 996 ) . "if(x++\n);" ], - // Unicode letter characters should pass through ok in identifiers (T33187) [ "var KaŝSkatolVal = {}", 'var KaŝSkatolVal={}' ], @@ -250,6 +247,17 @@ class JavaScriptMinifierTest extends PHPUnit\Framework\TestCase { ';', ], ], + [ + // Must not break before '++' + 'if(x++);', + [ + 'if', + '(', + 'x++', + ')', + ';', + ], + ], [ // Regression test for T201606. // Must not break between 'return' and Expression.