@@ -147,21 +147,52 @@ void main() {
147
147
route: '/' ,
148
148
middleware: null ,
149
149
files: [
150
- RouteFile (name: 'index' , path: 'index.dart' , route: '/' ),
151
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' ),
150
+ RouteFile (
151
+ name: 'index' ,
152
+ path: 'index.dart' ,
153
+ route: '/' ,
154
+ params: [],
155
+ ),
156
+ RouteFile (
157
+ name: 'hello' ,
158
+ path: 'hello.dart' ,
159
+ route: '/hello' ,
160
+ params: [],
161
+ ),
152
162
],
163
+ params: [],
153
164
)
154
165
],
155
166
routes: [
156
- RouteFile (name: 'index' , path: 'index.dart' , route: '/' ),
157
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' ),
167
+ RouteFile (
168
+ name: 'index' ,
169
+ path: 'index.dart' ,
170
+ route: '/' ,
171
+ params: [],
172
+ ),
173
+ RouteFile (
174
+ name: 'hello' ,
175
+ path: 'hello.dart' ,
176
+ route: '/hello' ,
177
+ params: [],
178
+ ),
158
179
],
159
180
endpoints: {
160
181
'/' : [
161
- RouteFile (name: 'index' , path: 'index.dart' , route: '/' ),
182
+ RouteFile (
183
+ name: 'index' ,
184
+ path: 'index.dart' ,
185
+ route: '/' ,
186
+ params: [],
187
+ ),
162
188
],
163
189
'/hello' : [
164
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' ),
190
+ RouteFile (
191
+ name: 'hello' ,
192
+ path: 'hello.dart' ,
193
+ route: '/hello' ,
194
+ params: [],
195
+ ),
165
196
]
166
197
},
167
198
rogueRoutes: [],
@@ -185,14 +216,35 @@ void main() {
185
216
'route' : '/' ,
186
217
'middleware' : false ,
187
218
'files' : [
188
- {'name' : 'index' , 'path' : 'index.dart' , 'route' : '/' },
189
- {'name' : 'hello' , 'path' : 'hello.dart' , 'route' : '/hello' }
190
- ]
219
+ {
220
+ 'name' : 'index' ,
221
+ 'path' : 'index.dart' ,
222
+ 'route' : '/' ,
223
+ 'file_params' : < String > [],
224
+ },
225
+ {
226
+ 'name' : 'hello' ,
227
+ 'path' : 'hello.dart' ,
228
+ 'route' : '/hello' ,
229
+ 'file_params' : < String > [],
230
+ }
231
+ ],
232
+ 'directory_params' : < String > [],
191
233
}
192
234
],
193
235
'routes' : [
194
- {'name' : 'index' , 'path' : 'index.dart' , 'route' : '/' },
195
- {'name' : 'hello' , 'path' : 'hello.dart' , 'route' : '/hello' }
236
+ {
237
+ 'name' : 'index' ,
238
+ 'path' : 'index.dart' ,
239
+ 'route' : '/' ,
240
+ 'file_params' : const < String > [],
241
+ },
242
+ {
243
+ 'name' : 'hello' ,
244
+ 'path' : 'hello.dart' ,
245
+ 'route' : '/hello' ,
246
+ 'file_params' : const < String > [],
247
+ }
196
248
],
197
249
'middleware' : [
198
250
{'name' : 'hello_middleware' , 'path' : 'hello/middleware.dart' }
@@ -227,10 +279,20 @@ void main() {
227
279
test ('reports nothing when there are endpoints and no conflicts' , () {
228
280
when (() => configuration.endpoints).thenReturn ({
229
281
'/' : const [
230
- RouteFile (name: 'index' , path: 'index.dart' , route: '/' ),
282
+ RouteFile (
283
+ name: 'index' ,
284
+ path: 'index.dart' ,
285
+ route: '/' ,
286
+ params: [],
287
+ ),
231
288
],
232
289
'/hello' : const [
233
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' )
290
+ RouteFile (
291
+ name: 'hello' ,
292
+ path: 'hello.dart' ,
293
+ route: '/hello' ,
294
+ params: [],
295
+ )
234
296
]
235
297
});
236
298
reportRouteConflicts (context, configuration);
@@ -241,11 +303,26 @@ void main() {
241
303
() {
242
304
when (() => configuration.endpoints).thenReturn ({
243
305
'/' : const [
244
- RouteFile (name: 'index' , path: 'index.dart' , route: '/' ),
306
+ RouteFile (
307
+ name: 'index' ,
308
+ path: 'index.dart' ,
309
+ route: '/' ,
310
+ params: [],
311
+ ),
245
312
],
246
313
'/hello' : const [
247
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' ),
248
- RouteFile (name: 'hello_index' , path: 'hello/index.dart' , route: '/' )
314
+ RouteFile (
315
+ name: 'hello' ,
316
+ path: 'hello.dart' ,
317
+ route: '/hello' ,
318
+ params: [],
319
+ ),
320
+ RouteFile (
321
+ name: 'hello_index' ,
322
+ path: 'hello/index.dart' ,
323
+ route: '/' ,
324
+ params: [],
325
+ )
249
326
]
250
327
});
251
328
reportRouteConflicts (context, configuration);
@@ -261,15 +338,40 @@ void main() {
261
338
'when there are multiple endpoint with conflicts' , () {
262
339
when (() => configuration.endpoints).thenReturn ({
263
340
'/' : const [
264
- RouteFile (name: 'index' , path: 'index.dart' , route: '/' ),
341
+ RouteFile (
342
+ name: 'index' ,
343
+ path: 'index.dart' ,
344
+ route: '/' ,
345
+ params: [],
346
+ ),
265
347
],
266
348
'/hello' : const [
267
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' ),
268
- RouteFile (name: 'hello_index' , path: 'hello/index.dart' , route: '/' )
349
+ RouteFile (
350
+ name: 'hello' ,
351
+ path: 'hello.dart' ,
352
+ route: '/hello' ,
353
+ params: [],
354
+ ),
355
+ RouteFile (
356
+ name: 'hello_index' ,
357
+ path: 'hello/index.dart' ,
358
+ route: '/' ,
359
+ params: [],
360
+ )
269
361
],
270
362
'/echo' : const [
271
- RouteFile (name: 'echo' , path: 'echo.dart' , route: '/echo' ),
272
- RouteFile (name: 'echo_index' , path: 'echo/index.dart' , route: '/' )
363
+ RouteFile (
364
+ name: 'echo' ,
365
+ path: 'echo.dart' ,
366
+ route: '/echo' ,
367
+ params: [],
368
+ ),
369
+ RouteFile (
370
+ name: 'echo_index' ,
371
+ path: 'echo/index.dart' ,
372
+ route: '/' ,
373
+ params: [],
374
+ )
273
375
]
274
376
});
275
377
reportRouteConflicts (context, configuration);
@@ -308,7 +410,12 @@ void main() {
308
410
test ('reports single rogue route' , () {
309
411
when (() => configuration.rogueRoutes).thenReturn (
310
412
const [
311
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' ),
413
+ RouteFile (
414
+ name: 'hello' ,
415
+ path: 'hello.dart' ,
416
+ route: '/hello' ,
417
+ params: [],
418
+ ),
312
419
],
313
420
);
314
421
reportRogueRoutes (context, configuration);
@@ -322,8 +429,18 @@ void main() {
322
429
test ('reports multiple rogue routes' , () {
323
430
when (() => configuration.rogueRoutes).thenReturn (
324
431
const [
325
- RouteFile (name: 'hello' , path: 'hello.dart' , route: '/hello' ),
326
- RouteFile (name: 'hi' , path: 'hi.dart' , route: '/hi' ),
432
+ RouteFile (
433
+ name: 'hello' ,
434
+ path: 'hello.dart' ,
435
+ route: '/hello' ,
436
+ params: [],
437
+ ),
438
+ RouteFile (
439
+ name: 'hi' ,
440
+ path: 'hi.dart' ,
441
+ route: '/hi' ,
442
+ params: [],
443
+ ),
327
444
],
328
445
);
329
446
reportRogueRoutes (context, configuration);
0 commit comments