@@ -123,70 +123,70 @@ var tests = [{
123
123
message : 'should process empty quoted strings (")' ,
124
124
fixture : '""' ,
125
125
expected : [
126
- { type : 'string' , value : '' , quote : '"' }
126
+ { type : 'string' , sourceIndex : 0 , value : '' , quote : '"' }
127
127
]
128
128
} , {
129
129
message : 'should process empty quoted strings (\')' ,
130
130
fixture : '\'\'' ,
131
131
expected : [
132
- { type : 'string' , value : '' , quote : '\'' }
132
+ { type : 'string' , sourceIndex : 0 , value : '' , quote : '\'' }
133
133
]
134
134
} , {
135
135
message : 'should process escaped quotes (\')' ,
136
136
fixture : '\'word\\\'word\'' ,
137
137
expected : [
138
- { type : 'string' , value : 'word\\\'word' , quote : '\'' }
138
+ { type : 'string' , sourceIndex : 0 , value : 'word\\\'word' , quote : '\'' }
139
139
]
140
140
} , {
141
141
message : 'should process escaped quotes (\')' ,
142
142
fixture : '"word\\"word"' ,
143
143
expected : [
144
- { type : 'string' , value : 'word\\"word' , quote : '"' }
144
+ { type : 'string' , sourceIndex : 0 , value : 'word\\"word' , quote : '"' }
145
145
]
146
146
} , {
147
147
message : 'should process single quotes inside double quotes (\')' ,
148
148
fixture : '"word\'word"' ,
149
149
expected : [
150
- { type : 'string' , value : 'word\'word' , quote : '"' }
150
+ { type : 'string' , sourceIndex : 0 , value : 'word\'word' , quote : '"' }
151
151
]
152
152
} , {
153
153
message : 'should process double quotes inside single quotes (\')' ,
154
154
fixture : '\'word"word\'' ,
155
155
expected : [
156
- { type : 'string' , value : 'word"word' , quote : '\'' }
156
+ { type : 'string' , sourceIndex : 0 , value : 'word"word' , quote : '\'' }
157
157
]
158
158
} , {
159
159
message : 'should process unclosed quotes' ,
160
160
fixture : '"word' ,
161
161
expected : [
162
- { type : 'string' , value : 'word' , quote : '"' , unclosed : true }
162
+ { type : 'string' , sourceIndex : 0 , value : 'word' , quote : '"' , unclosed : true }
163
163
]
164
164
} , {
165
165
message : 'should process unclosed quotes with ended backslash' ,
166
166
fixture : '"word\\' ,
167
167
expected : [
168
- { type : 'string' , value : 'word\\' , quote : '"' , unclosed : true }
168
+ { type : 'string' , sourceIndex : 0 , value : 'word\\' , quote : '"' , unclosed : true }
169
169
]
170
170
} , {
171
171
message : 'should process quoted strings' ,
172
172
fixture : '"string"' ,
173
173
expected : [
174
- { type : 'string' , value : 'string' , quote : '"' }
174
+ { type : 'string' , sourceIndex : 0 , value : 'string' , quote : '"' }
175
175
]
176
176
} , {
177
177
message : 'should process quoted strings and words' ,
178
178
fixture : 'word1"string"word2' ,
179
179
expected : [
180
180
{ type : 'word' , value : 'word1' } ,
181
- { type : 'string' , value : 'string' , quote : '"' } ,
181
+ { type : 'string' , sourceIndex : 5 , value : 'string' , quote : '"' } ,
182
182
{ type : 'word' , value : 'word2' }
183
183
]
184
184
} , {
185
185
message : 'should process quoted strings and spaces' ,
186
186
fixture : ' "string" ' ,
187
187
expected : [
188
188
{ type : 'space' , sourceIndex : 0 , value : ' ' } ,
189
- { type : 'string' , value : 'string' , quote : '"' } ,
189
+ { type : 'string' , sourceIndex : 1 , value : 'string' , quote : '"' } ,
190
190
{ type : 'space' , sourceIndex : 9 , value : ' ' }
191
191
]
192
192
} , {
@@ -209,11 +209,11 @@ var tests = [{
209
209
{ type : 'div' , value : '/' , before : ' \t ' , after : '' } ,
210
210
{ type : 'word' , value : '3' } ,
211
211
{ type : 'space' , sourceIndex : 21 , value : ' ' } ,
212
- { type : 'string' , value : 'Open Sans' , quote : '\'' } ,
212
+ { type : 'string' , sourceIndex : 22 , value : 'Open Sans' , quote : '\'' } ,
213
213
{ type : 'div' , value : ',' , before : '' , after : ' ' } ,
214
214
{ type : 'word' , value : 'Arial' } ,
215
215
{ type : 'div' , value : ',' , before : '' , after : ' ' } ,
216
- { type : 'string' , value : 'Helvetica Neue' , quote : '"' } ,
216
+ { type : 'string' , sourceIndex : 42 , value : 'Helvetica Neue' , quote : '"' } ,
217
217
{ type : 'div' , value : ',' , before : '' , after : ' ' } ,
218
218
{ type : 'word' , value : 'sans-serif' } ,
219
219
]
@@ -251,7 +251,7 @@ var tests = [{
251
251
fixture : 'url( "/gfx/img/bg.jpg" hello )' ,
252
252
expected : [
253
253
{ type : 'function' , value : 'url' , before : ' ' , after : ' ' , nodes : [
254
- { type : 'string' , quote : '"' , value : '/gfx/img/bg.jpg' } ,
254
+ { type : 'string' , sourceIndex : 5 , quote : '"' , value : '/gfx/img/bg.jpg' } ,
255
255
{ type : 'space' , sourceIndex : 22 , value : ' ' } ,
256
256
{ type : 'word' , value : 'hello' }
257
257
] }
0 commit comments