// CSSFixerTest.java

/**
*    Copyright (C) 2008 10gen Inc.
*  
*    This program is free software: you can redistribute it and/or  modify
*    it under the terms of the GNU Affero General Public License, version 3,
*    as published by the Free Software Foundation.
*  
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU Affero General Public License for more details.
*  
*    You should have received a copy of the GNU Affero General Public License
*    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package ed.appserver;

import org.testng.annotations.Test;

public class CSSFixerTest extends ed.TestCase {

    CSSFixer fixer = new CSSFixer( new URLFixer( "P" , "S=1" , null ) );

    @Test(groups = {"basic"})    
    public void testBasic(){
        assertClose( "body { color: red; }" , fixer.fixSingeLine( "body { color: red; }" ) );
        assertClose( "body { color: red; url(P/a.jpg?S=1); }" , fixer.fixSingeLine( "body { color: red; url(/a.jpg); }" ) );
        assertClose( "body { color: red; url(P/a.jpg?z=1&S=1); }" , fixer.fixSingeLine( "body { color: red; url(/a.jpg?z=1); }" ) );
    }

    public static void main( String args[] ){
        (new CSSFixerTest()).runConsole();
    }
}

@@ -55,19 +55,17 @@
 n Inc.%0A*
-  
 %0A
+
 *    Thi
@@ -260,18 +260,16 @@
 ation.%0A*
-  
 %0A*    Th
@@ -523,18 +523,16 @@
 tails.%0A*
-  
 %0A*    Yo
@@ -893,20 +893,16 @@
 basic%22%7D)
-    
 %0A    pub
@@ -1134,32 +1134,32 @@
 a.jpg); %7D%22 ) );%0A
-
         assertCl
@@ -1282,16 +1282,509 @@
 %0A    %7D%0A%0A
+    @Test(groups = %7B%22basic%22%7D)%0A    public void testQuoted() %7B%0A        assertClose(fixer.fixSingeLine(%22body %7B color: red; url(/a.jpg); %7D%22), fixer.fixSingeLine(%22body %7B color: red; url('/a.jpg'); %7D%22));%0A        assertClose(fixer.fixSingeLine(%22body %7B color: red; url(/a.jpg); %7D%22), fixer.fixSingeLine(%22body %7B color: red; url(%5C%22/a.jpg%5C%22); %7D%22));%0A        assertClose(fixer.fixSingeLine(%22body %7B color: red; url(  '/a.jpg' ); %7D%22), fixer.fixSingeLine(%22body %7B color: red; url(%5C%22/a.jpg%5C%22     ); %7D%22));%0A    %7D%0A%0A
     publ

test quoted CSS url()s