3 require_once '_inc.php';
5 require_once 'Minify/CommentPreserver.php';
7 function test_Minify_CommentPreserver()
13 ,'/*!*/a' => "\n/**/\n1A"
14 ,'a/*!*//*!*/b' => "2A\n/**/\n\n/**/\n3B"
15 ,'a/*!*/b/*!*/' => "4A\n/**/\n5B\n/**/\n"
18 foreach ($inOut as $in => $expected) {
19 $actual = Minify_CommentPreserver::process($in, '_test_MCP_processor');
20 $passed = assertTrue($expected === $actual, 'Minify_CommentPreserver');
21 if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
22 echo "\n---Output: " .strlen($actual). " bytes\n\n{$actual}\n\n";
24 echo "---Expected: " .strlen($expected). " bytes\n\n{$expected}\n\n\n";
30 function _test_MCP_processor($content, $options = array())
32 static $callCount = 0;
34 return $callCount . strtoupper($content);
37 test_Minify_CommentPreserver();