@@ -19,7 +19,7 @@ describe("url", function() {
1919 [ 1 , ".class { background: green url(\"{./img img.png}\") xyz }" , "" ]
2020 ] ) ;
2121 test ( "background 2 img contain space in name" , ".class { background: green url( 'img img.png' ) xyz }" , [
22- [ 1 , ".class { background: green url(' {./img img.png}' ) xyz }" , "" ]
22+ [ 1 , ".class { background: green url(\" {./img img.png}\" ) xyz }" , "" ]
2323 ] ) ;
2424 test ( "background img absolute" , ".class { background: green url(/img.png) xyz }" , [
2525 [ 1 , ".class { background: green url(/img.png) xyz }" , "" ]
@@ -103,6 +103,28 @@ describe("url", function() {
103103 test ( "external schema-less url" , ".class { background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz }" , [
104104 [ 1 , ".class { background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz }" , "" ]
105105 ] ) ;
106+
107+ test ( "module wrapped in spaces" , ".class { background: green url(module) xyz }" , [
108+ [ 1 , ".class { background: green url(module-wrapped) xyz }" , "" ]
109+ ] , "" , { './module' : "\"module-wrapped\"" } ) ;
110+ test ( "module with space" , ".class { background: green url(module) xyz }" , [
111+ [ 1 , ".class { background: green url(\"module with space\") xyz }" , "" ]
112+ ] , "" , { './module' : "module with space" } ) ;
113+ test ( "module with quote" , ".class { background: green url(module) xyz }" , [
114+ [ 1 , ".class { background: green url(\"module\\\"with\\\"quote\") xyz }" , "" ]
115+ ] , "" , { './module' : "module\"with\"quote" } ) ;
116+ test ( "module with quote wrapped" , ".class { background: green url(module) xyz }" , [
117+ [ 1 , ".class { background: green url(\"module\\\"with\\\"quote\\\"wrapped\") xyz }" , "" ]
118+ ] , "" , { './module' : "\"module\"with\"quote\"wrapped\"" } ) ;
119+ test ( "module with parens" , ".class { background: green url(module) xyz }" , [
120+ [ 1 , ".class { background: green url(\"module(with-parens)\") xyz }" , "" ]
121+ ] , "" , { './module' : 'module(with-parens)' } ) ;
122+ test ( "module with newline" , ".class { background: green url(module) xyz }" , [
123+ [ 1 , ".class { background: green url(\"module\\nwith\\nnewline\") xyz }" , "" ]
124+ ] , "" , { './module' : "module\nwith\nnewline" } ) ;
125+ test ( "module from url-loader" , ".class { background: green url(module) xyz }" , [
126+ [ 1 , ".class { background: green url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA) xyz }" , "" ]
127+ ] , "" , { './module' : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA" } ) ;
106128
107129 test ( "background img with url" , ".class { background: green url( \"img.png\" ) xyz }" , [
108130 [ 1 , ".class { background: green url( \"img.png\" ) xyz }" , "" ]
0 commit comments