@@ -116,36 +116,43 @@ describe("compiler pass |inferenceMatchResult|", () => {
116
116
expect ( pass ) . to . changeAST ( "start = ''| .. |" , { rules : [ { match : 1 } ] } ) ;
117
117
expect ( pass ) . to . changeAST ( "start = []| .. |" , { rules : [ { match : 1 } ] } ) ;
118
118
} ) ;
119
+
119
120
it ( "for | ..1| correctly" , ( ) => {
120
121
expect ( pass ) . to . changeAST ( "start = .| ..1|" , { rules : [ { match : 1 } ] } ) ;
121
122
expect ( pass ) . to . changeAST ( "start = ''| ..1|" , { rules : [ { match : 1 } ] } ) ;
122
123
expect ( pass ) . to . changeAST ( "start = []| ..1|" , { rules : [ { match : 1 } ] } ) ;
123
124
} ) ;
125
+
124
126
it ( "for | ..3| correctly" , ( ) => {
125
127
expect ( pass ) . to . changeAST ( "start = .| ..3|" , { rules : [ { match : 1 } ] } ) ;
126
128
expect ( pass ) . to . changeAST ( "start = ''| ..3|" , { rules : [ { match : 1 } ] } ) ;
127
129
expect ( pass ) . to . changeAST ( "start = []| ..3|" , { rules : [ { match : 1 } ] } ) ;
128
130
} ) ;
131
+
129
132
it ( "for |0.. | correctly" , ( ) => {
130
133
expect ( pass ) . to . changeAST ( "start = .|0.. |" , { rules : [ { match : 1 } ] } ) ;
131
134
expect ( pass ) . to . changeAST ( "start = ''|0.. |" , { rules : [ { match : 1 } ] } ) ;
132
135
expect ( pass ) . to . changeAST ( "start = []|0.. |" , { rules : [ { match : 1 } ] } ) ;
133
136
} ) ;
137
+
134
138
it ( "for |1.. | correctly" , ( ) => {
135
139
expect ( pass ) . to . changeAST ( "start = .|1.. |" , { rules : [ { match : 0 } ] } ) ;
136
140
expect ( pass ) . to . changeAST ( "start = ''|1.. |" , { rules : [ { match : 1 } ] } ) ;
137
141
expect ( pass ) . to . changeAST ( "start = []|1.. |" , { rules : [ { match : - 1 } ] } ) ;
138
142
} ) ;
143
+
139
144
it ( "for |2.. | correctly" , ( ) => {
140
145
expect ( pass ) . to . changeAST ( "start = .|2.. |" , { rules : [ { match : 0 } ] } ) ;
141
146
expect ( pass ) . to . changeAST ( "start = ''|2.. |" , { rules : [ { match : 1 } ] } ) ;
142
147
expect ( pass ) . to . changeAST ( "start = []|2.. |" , { rules : [ { match : - 1 } ] } ) ;
143
148
} ) ;
149
+
144
150
it ( "for |2..3| correctly" , ( ) => {
145
151
expect ( pass ) . to . changeAST ( "start = .|2..3|" , { rules : [ { match : 0 } ] } ) ;
146
152
expect ( pass ) . to . changeAST ( "start = ''|2..3|" , { rules : [ { match : 1 } ] } ) ;
147
153
expect ( pass ) . to . changeAST ( "start = []|2..3|" , { rules : [ { match : - 1 } ] } ) ;
148
154
} ) ;
155
+
149
156
it ( "for | 42 | correctly" , ( ) => {
150
157
expect ( pass ) . to . changeAST ( "start = .| 42 |" , { rules : [ { match : 0 } ] } ) ;
151
158
expect ( pass ) . to . changeAST ( "start = ''| 42 |" , { rules : [ { match : 1 } ] } ) ;
@@ -159,16 +166,19 @@ describe("compiler pass |inferenceMatchResult|", () => {
159
166
expect ( pass ) . to . changeAST ( "start = ''| ..max|" , { rules : [ { match : 0 } ] } ) ;
160
167
expect ( pass ) . to . changeAST ( "start = []| ..max|" , { rules : [ { match : 0 } ] } ) ;
161
168
} ) ;
169
+
162
170
it ( "for |min.. | correctly" , ( ) => {
163
171
expect ( pass ) . to . changeAST ( "start = .|min.. |" , { rules : [ { match : 0 } ] } ) ;
164
172
expect ( pass ) . to . changeAST ( "start = ''|min.. |" , { rules : [ { match : 0 } ] } ) ;
165
173
expect ( pass ) . to . changeAST ( "start = []|min.. |" , { rules : [ { match : 0 } ] } ) ;
166
174
} ) ;
175
+
167
176
it ( "for |min..max| correctly" , ( ) => {
168
177
expect ( pass ) . to . changeAST ( "start = .|min..max|" , { rules : [ { match : 0 } ] } ) ;
169
178
expect ( pass ) . to . changeAST ( "start = ''|min..max|" , { rules : [ { match : 0 } ] } ) ;
170
179
expect ( pass ) . to . changeAST ( "start = []|min..max|" , { rules : [ { match : 0 } ] } ) ;
171
180
} ) ;
181
+
172
182
it ( "for | exact | correctly" , ( ) => {
173
183
expect ( pass ) . to . changeAST ( "start = .|exact|" , { rules : [ { match : 0 } ] } ) ;
174
184
expect ( pass ) . to . changeAST ( "start = ''|exact|" , { rules : [ { match : 0 } ] } ) ;
@@ -182,16 +192,19 @@ describe("compiler pass |inferenceMatchResult|", () => {
182
192
expect ( pass ) . to . changeAST ( "start = ''| ..{}|" , { rules : [ { match : 0 } ] } ) ;
183
193
expect ( pass ) . to . changeAST ( "start = []| ..{}|" , { rules : [ { match : 0 } ] } ) ;
184
194
} ) ;
195
+
185
196
it ( "for |{}.. | correctly" , ( ) => {
186
197
expect ( pass ) . to . changeAST ( "start = .|{}.. |" , { rules : [ { match : 0 } ] } ) ;
187
198
expect ( pass ) . to . changeAST ( "start = ''|{}.. |" , { rules : [ { match : 0 } ] } ) ;
188
199
expect ( pass ) . to . changeAST ( "start = []|{}.. |" , { rules : [ { match : 0 } ] } ) ;
189
200
} ) ;
201
+
190
202
it ( "for |{}..{}| correctly" , ( ) => {
191
203
expect ( pass ) . to . changeAST ( "start = .|{}..{}|" , { rules : [ { match : 0 } ] } ) ;
192
204
expect ( pass ) . to . changeAST ( "start = ''|{}..{}|" , { rules : [ { match : 0 } ] } ) ;
193
205
expect ( pass ) . to . changeAST ( "start = []|{}..{}|" , { rules : [ { match : 0 } ] } ) ;
194
206
} ) ;
207
+
195
208
it ( "for | {} | correctly" , ( ) => {
196
209
expect ( pass ) . to . changeAST ( "start = .|{}|" , { rules : [ { match : 0 } ] } ) ;
197
210
expect ( pass ) . to . changeAST ( "start = ''|{}|" , { rules : [ { match : 0 } ] } ) ;
@@ -215,6 +228,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
215
228
expect ( pass ) . to . changeAST ( "start = []| .. ,''|" , { rules : [ { match : 1 } ] } ) ;
216
229
expect ( pass ) . to . changeAST ( "start = []| .. ,[]|" , { rules : [ { match : 1 } ] } ) ;
217
230
} ) ;
231
+
218
232
it ( "for | ..1, delimiter| correctly" , ( ) => {
219
233
expect ( pass ) . to . changeAST ( "start = .| ..1, .|" , { rules : [ { match : 1 } ] } ) ;
220
234
expect ( pass ) . to . changeAST ( "start = .| ..1,''|" , { rules : [ { match : 1 } ] } ) ;
@@ -228,6 +242,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
228
242
expect ( pass ) . to . changeAST ( "start = []| ..1,''|" , { rules : [ { match : 1 } ] } ) ;
229
243
expect ( pass ) . to . changeAST ( "start = []| ..1,[]|" , { rules : [ { match : 1 } ] } ) ;
230
244
} ) ;
245
+
231
246
it ( "for | ..3, delimiter| correctly" , ( ) => {
232
247
expect ( pass ) . to . changeAST ( "start = .| ..3, .|" , { rules : [ { match : 1 } ] } ) ;
233
248
expect ( pass ) . to . changeAST ( "start = .| ..3,''|" , { rules : [ { match : 1 } ] } ) ;
@@ -241,6 +256,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
241
256
expect ( pass ) . to . changeAST ( "start = []| ..3,''|" , { rules : [ { match : 1 } ] } ) ;
242
257
expect ( pass ) . to . changeAST ( "start = []| ..3,[]|" , { rules : [ { match : 1 } ] } ) ;
243
258
} ) ;
259
+
244
260
it ( "for |0.. , delimiter| correctly" , ( ) => {
245
261
expect ( pass ) . to . changeAST ( "start = .|0.. , .|" , { rules : [ { match : 1 } ] } ) ;
246
262
expect ( pass ) . to . changeAST ( "start = .|0.. ,''|" , { rules : [ { match : 1 } ] } ) ;
@@ -254,6 +270,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
254
270
expect ( pass ) . to . changeAST ( "start = []|0.. ,''|" , { rules : [ { match : 1 } ] } ) ;
255
271
expect ( pass ) . to . changeAST ( "start = []|0.. ,[]|" , { rules : [ { match : 1 } ] } ) ;
256
272
} ) ;
273
+
257
274
it ( "for |1.. , delimiter| correctly" , ( ) => {
258
275
expect ( pass ) . to . changeAST ( "start = .|1.. , .|" , { rules : [ { match : 0 } ] } ) ;
259
276
expect ( pass ) . to . changeAST ( "start = .|1.. ,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -267,6 +284,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
267
284
expect ( pass ) . to . changeAST ( "start = []|1.. ,''|" , { rules : [ { match : - 1 } ] } ) ;
268
285
expect ( pass ) . to . changeAST ( "start = []|1.. ,[]|" , { rules : [ { match : - 1 } ] } ) ;
269
286
} ) ;
287
+
270
288
it ( "for |2.. , delimiter| correctly" , ( ) => {
271
289
expect ( pass ) . to . changeAST ( "start = .|2.. , .|" , { rules : [ { match : 0 } ] } ) ;
272
290
expect ( pass ) . to . changeAST ( "start = .|2.. ,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -280,6 +298,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
280
298
expect ( pass ) . to . changeAST ( "start = []|2.. ,''|" , { rules : [ { match : - 1 } ] } ) ;
281
299
expect ( pass ) . to . changeAST ( "start = []|2.. ,[]|" , { rules : [ { match : - 1 } ] } ) ;
282
300
} ) ;
301
+
283
302
it ( "for |2..3, delimiter| correctly" , ( ) => {
284
303
expect ( pass ) . to . changeAST ( "start = .|2..3, .|" , { rules : [ { match : 0 } ] } ) ;
285
304
expect ( pass ) . to . changeAST ( "start = .|2..3,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -293,6 +312,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
293
312
expect ( pass ) . to . changeAST ( "start = []|2..3,''|" , { rules : [ { match : - 1 } ] } ) ;
294
313
expect ( pass ) . to . changeAST ( "start = []|2..3,[]|" , { rules : [ { match : - 1 } ] } ) ;
295
314
} ) ;
315
+
296
316
it ( "for | 42 , delimiter| correctly" , ( ) => {
297
317
expect ( pass ) . to . changeAST ( "start = .| 42 , .|" , { rules : [ { match : 0 } ] } ) ;
298
318
expect ( pass ) . to . changeAST ( "start = .| 42 ,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -322,6 +342,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
322
342
expect ( pass ) . to . changeAST ( "start = []| ..max,''|" , { rules : [ { match : 0 } ] } ) ;
323
343
expect ( pass ) . to . changeAST ( "start = []| ..max,[]|" , { rules : [ { match : 0 } ] } ) ;
324
344
} ) ;
345
+
325
346
it ( "for |min.. , delimiter| correctly" , ( ) => {
326
347
expect ( pass ) . to . changeAST ( "start = .|min.. , .|" , { rules : [ { match : 0 } ] } ) ;
327
348
expect ( pass ) . to . changeAST ( "start = .|min.. ,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -335,6 +356,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
335
356
expect ( pass ) . to . changeAST ( "start = []|min.. ,''|" , { rules : [ { match : 0 } ] } ) ;
336
357
expect ( pass ) . to . changeAST ( "start = []|min.. ,[]|" , { rules : [ { match : 0 } ] } ) ;
337
358
} ) ;
359
+
338
360
it ( "for |min..max, delimiter| correctly" , ( ) => {
339
361
expect ( pass ) . to . changeAST ( "start = .|min..max, .|" , { rules : [ { match : 0 } ] } ) ;
340
362
expect ( pass ) . to . changeAST ( "start = .|min..max,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -348,6 +370,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
348
370
expect ( pass ) . to . changeAST ( "start = []|min..max,''|" , { rules : [ { match : 0 } ] } ) ;
349
371
expect ( pass ) . to . changeAST ( "start = []|min..max,[]|" , { rules : [ { match : 0 } ] } ) ;
350
372
} ) ;
373
+
351
374
it ( "for | exact , delimiter| correctly" , ( ) => {
352
375
expect ( pass ) . to . changeAST ( "start = .| exact , .|" , { rules : [ { match : 0 } ] } ) ;
353
376
expect ( pass ) . to . changeAST ( "start = .| exact ,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -377,6 +400,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
377
400
expect ( pass ) . to . changeAST ( "start = []| ..{},''|" , { rules : [ { match : 0 } ] } ) ;
378
401
expect ( pass ) . to . changeAST ( "start = []| ..{},[]|" , { rules : [ { match : 0 } ] } ) ;
379
402
} ) ;
403
+
380
404
it ( "for |{}.. , delimiter| correctly" , ( ) => {
381
405
expect ( pass ) . to . changeAST ( "start = .|{}.. , .|" , { rules : [ { match : 0 } ] } ) ;
382
406
expect ( pass ) . to . changeAST ( "start = .|{}.. ,''|" , { rules : [ { match : 0 } ] } ) ;
@@ -390,6 +414,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
390
414
expect ( pass ) . to . changeAST ( "start = []|{}.. ,''|" , { rules : [ { match : 0 } ] } ) ;
391
415
expect ( pass ) . to . changeAST ( "start = []|{}.. ,[]|" , { rules : [ { match : 0 } ] } ) ;
392
416
} ) ;
417
+
393
418
it ( "for |{}..{}, delimiter| correctly" , ( ) => {
394
419
expect ( pass ) . to . changeAST ( "start = .|{}..{}, .|" , { rules : [ { match : 0 } ] } ) ;
395
420
expect ( pass ) . to . changeAST ( "start = .|{}..{},''|" , { rules : [ { match : 0 } ] } ) ;
@@ -403,6 +428,7 @@ describe("compiler pass |inferenceMatchResult|", () => {
403
428
expect ( pass ) . to . changeAST ( "start = []|{}..{},''|" , { rules : [ { match : 0 } ] } ) ;
404
429
expect ( pass ) . to . changeAST ( "start = []|{}..{},[]|" , { rules : [ { match : 0 } ] } ) ;
405
430
} ) ;
431
+
406
432
it ( "for | {} , delimiter| correctly" , ( ) => {
407
433
expect ( pass ) . to . changeAST ( "start = .| {} , .|" , { rules : [ { match : 0 } ] } ) ;
408
434
expect ( pass ) . to . changeAST ( "start = .| {} ,''|" , { rules : [ { match : 0 } ] } ) ;
0 commit comments