@@ -19,7 +19,7 @@ describe("url", function() {
19
19
[ 1 , ".class { background: green url(\"{./img img.png}\") xyz }" , "" ]
20
20
] ) ;
21
21
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 }" , "" ]
23
23
] ) ;
24
24
test ( "background img absolute" , ".class { background: green url(/img.png) xyz }" , [
25
25
[ 1 , ".class { background: green url(/img.png) xyz }" , "" ]
@@ -103,6 +103,28 @@ describe("url", function() {
103
103
test ( "external schema-less url" , ".class { background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz }" , [
104
104
[ 1 , ".class { background: green url(//raw.githubusercontent.com/webpack/media/master/logo/icon.png) xyz }" , "" ]
105
105
] ) ;
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" } ) ;
106
128
107
129
test ( "background img with url" , ".class { background: green url( \"img.png\" ) xyz }" , [
108
130
[ 1 , ".class { background: green url( \"img.png\" ) xyz }" , "" ]
0 commit comments