JavaScriptMinifier: Move test case for 'x++' to provideLineBreaker()
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 11 Aug 2018 23:24:10 +0000 (00:24 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 11 Aug 2018 23:24:10 +0000 (00:24 +0100)
Easier to read.

Bug: T201606
Change-Id: Ie12910edf5ab6a9d7246000ca78a3c9208aeb152

tests/phpunit/includes/libs/JavaScriptMinifierTest.php

index 3e37f15..ce8bb06 100644 (file)
@@ -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.