From e4d9ebdc480925a54f19480125b2cebffe73acce Mon Sep 17 00:00:00 2001 From: Matthias Mullie Date: Fri, 15 Mar 2024 10:21:38 +0100 Subject: [PATCH] Restructure js test --- tests/JS/JSTest.php | 12 ++++++------ tests/JS/sample/{source => bugs/393}/Decrypt.js | 0 .../JS/sample/{minified2 => bugs/393}/Decrypt.min.js | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) rename tests/JS/sample/{source => bugs/393}/Decrypt.js (100%) rename tests/JS/sample/{minified2 => bugs/393}/Decrypt.min.js (99%) diff --git a/tests/JS/JSTest.php b/tests/JS/JSTest.php index ff82068..7e0e156 100644 --- a/tests/JS/JSTest.php +++ b/tests/JS/JSTest.php @@ -1283,6 +1283,12 @@ a = \'b\';', file_get_contents(__DIR__ . '/sample/bugs/229/minified.js'), ); + // https://github.com/matthiasmullie/minify/issues/393 + $tests[] = array( + __DIR__ . '/sample/bugs/393/Decrypt.js', + file_get_contents(__DIR__ . '/sample/bugs/393/Decrypt.min.js'), + ); + // https://github.com/matthiasmullie/minify/issues/231 $tests[] = array( 'var x = (2 + 2) / 2; /// =2', @@ -1385,12 +1391,6 @@ b=2', } } - // some other files that are minified correctly, ensure they stay like this - // https://github.com/matthiasmullie/minify/issues/393 - $source = trim(file_get_contents(__DIR__ . '/sample/source/Decrypt.js')); - $minified = trim(file_get_contents(__DIR__ . '/sample/minified2/Decrypt.min.js')); - $tests[] = array($source, $minified); - return $tests; } } diff --git a/tests/JS/sample/source/Decrypt.js b/tests/JS/sample/bugs/393/Decrypt.js similarity index 100% rename from tests/JS/sample/source/Decrypt.js rename to tests/JS/sample/bugs/393/Decrypt.js diff --git a/tests/JS/sample/minified2/Decrypt.min.js b/tests/JS/sample/bugs/393/Decrypt.min.js similarity index 99% rename from tests/JS/sample/minified2/Decrypt.min.js rename to tests/JS/sample/bugs/393/Decrypt.min.js index 48f0ccf..3da9ce1 100644 --- a/tests/JS/sample/minified2/Decrypt.min.js +++ b/tests/JS/sample/bugs/393/Decrypt.min.js @@ -85,4 +85,4 @@ return!1;return ciphers[cipher][1]} pub.list_algorithms=function(){var ret=[];for(var i in ciphers) ret.push(i);return ret} pub.list_modes=function(){return['ecb','cbc','cfb','ncfb','nofb','ctr']} -var cMode='cbc';var cCipher='rijndael-128';var cKey='12345678911234567892123456789312';return pub} +var cMode='cbc';var cCipher='rijndael-128';var cKey='12345678911234567892123456789312';return pub} \ No newline at end of file