--- /dev/null
+<?php
+/**
+ * @group Distiller
+ */
+class JavaScriptDistillerTest extends PHPUnit_Framework_TestCase {
+ public function testDistiller() {
+ $in = self::read( 'distiller-in.js' );
+ $out = self::read( 'distiller-out.js' );
+ $outFull = self::read( 'distiller-out-full.js' );
+ $this->assertEquals( $out, JavaScriptDistiller::stripWhiteSpace( $in ) );
+ $this->assertEquals( $outFull, JavaScriptDistiller::stripWhiteSpace( $in, true ) );
+ }
+
+ private static function read( $file ) {
+ $text = file_get_contents( dirname( __FILE__ ) . "/$file" );
+ return str_replace( "\r\n", "\n", $text );
+ }
+}
\ No newline at end of file
--- /dev/null
+/* this is a comment */
+/* a multi-
+ line comment */
+/* a /* weird comment */
+// one-line comment
+var string = /* comment */'/* comment in string */';
+
+move_to_the_same_line()
+
+ dont_move();
+
+if ( / a + bfoo.* /i.test( bar ) && ( a / b ) * c + d - e) { /* blah */
+ statement();
+ statement()
+}
\ No newline at end of file
--- /dev/null
+
+
+
+
+var string='/* comment in string */';move_to_the_same_line()
+dont_move();if(/ a + bfoo.* /i.test(bar)&&(a/ b ) * c + d - e){
+statement();statement()}
\ No newline at end of file
--- /dev/null
+
+
+
+
+var string='/* comment in string */';
+move_to_the_same_line()
+dont_move();
+if(/ a + bfoo.* /i.test(bar)&&(a/ b ) * c + d - e) { /*blah*/
+statement();
+statement()
+}
\ No newline at end of file