From da3aa28cea9fa26a21e5478f89d71347010c6b9f Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sun, 12 Aug 2018 00:24:10 +0100 Subject: [PATCH] JavaScriptMinifier: Move test case for 'x++' to provideLineBreaker() Easier to read. Bug: T201606 Change-Id: Ie12910edf5ab6a9d7246000ca78a3c9208aeb152 --- .../includes/libs/JavaScriptMinifierTest.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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. -- 2.20.1