mirror of
https://github.com/mrclay/minify.git
synced 2025-08-19 04:11:20 +02:00
add test for closure compiler tags validation
https://code.google.com/p/closure-compiler/issues/detail?id=513
This commit is contained in:
@@ -62,9 +62,27 @@ class MinifyClosureCompilerTest extends TestCase
|
||||
$this->assertHasJar();
|
||||
$src = "function unused() {};";
|
||||
$minExpected = '';
|
||||
$minOutput = Minify_ClosureCompiler::minify($src, array(
|
||||
$options = array(
|
||||
Minify_ClosureCompiler::OPTION_COMPILATION_LEVEL => 'ADVANCED_OPTIMIZATIONS'
|
||||
));
|
||||
);
|
||||
$minOutput = Minify_ClosureCompiler::minify($src, $options);
|
||||
$this->assertSame($minExpected, $minOutput, 'advanced optimizations');
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that closure compiler does not produce unneeded noise
|
||||
*
|
||||
* @see https://code.google.com/p/closure-compiler/issues/detail?id=513
|
||||
*
|
||||
* NOTE: this test does not actually cover it, result is manually verified.
|
||||
*/
|
||||
public function test4()
|
||||
{
|
||||
$this->assertHasJar();
|
||||
|
||||
$src = file_get_contents(self::$test_files . '/bug-513.js');
|
||||
$minExpected = 'var a=4;';
|
||||
$minOutput = Minify_ClosureCompiler::minify($src);
|
||||
$this->assertSame($minExpected, $minOutput, 'advanced optimizations');
|
||||
}
|
||||
|
||||
@@ -77,4 +95,4 @@ class MinifyClosureCompilerTest extends TestCase
|
||||
$this->markTestSkipped($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user