@@ -90,6 +90,8 @@ import 'annotations.dart';
90
90
var generatedContent = await File (
91
91
'${d .sandbox }/foo_package/lib/foo.aot_renderers_for_html.dart' )
92
92
.readAsString ();
93
+ generatedContent = generatedContent.replaceFirst (
94
+ "import 'foo.dart';" , "import 'package:foo/foo.dart';" );
93
95
renderScript.writeAsStringSync ('''
94
96
import 'dart:io';
95
97
@@ -179,7 +181,7 @@ void main() {
179
181
() => [
180
182
d.dir ('lib/templates/html' , [d.file ('foo.html' , 'Text {{s1}}' )]),
181
183
],
182
- '_i1. Foo()..s1 = "<p>hello</p>"' ,
184
+ 'Foo()..s1 = "<p>hello</p>"' ,
183
185
);
184
186
expect (output, equals ('Text <p>hello</p>' ));
185
187
});
@@ -189,7 +191,7 @@ void main() {
189
191
() => [
190
192
d.dir ('lib/templates/html' , [d.file ('foo.html' , 'Text {{{s1}}}' )]),
191
193
],
192
- '_i1. Foo()..s1 = "<p>hello</p>"' ,
194
+ 'Foo()..s1 = "<p>hello</p>"' ,
193
195
);
194
196
expect (output, equals ('Text <p>hello</p>' ));
195
197
});
@@ -199,7 +201,7 @@ void main() {
199
201
() => [
200
202
d.dir ('lib/templates/html' , [d.file ('foo.html' , 'Text {{b1}}' )]),
201
203
],
202
- '_i1. Foo()..b1 = true' ,
204
+ 'Foo()..b1 = true' ,
203
205
);
204
206
expect (output, equals ('Text true' ));
205
207
});
@@ -209,7 +211,7 @@ void main() {
209
211
() => [
210
212
d.dir ('lib/templates/html' , [d.file ('foo.html' , 'Text {{l1}}' )]),
211
213
],
212
- '_i1. Foo()..l1 = [1, 2, 3]' ,
214
+ 'Foo()..l1 = [1, 2, 3]' ,
213
215
);
214
216
expect (output, equals ('Text [1, 2, 3]' ));
215
217
});
@@ -220,7 +222,7 @@ void main() {
220
222
d.dir ('lib/templates/html' ,
221
223
[d.file ('foo.html' , 'Text {{#b1}}Section{{/b1}}' )]),
222
224
],
223
- '_i1. Foo()..b1 = true' ,
225
+ 'Foo()..b1 = true' ,
224
226
);
225
227
expect (output, equals ('Text Section' ));
226
228
});
@@ -231,7 +233,7 @@ void main() {
231
233
d.dir ('lib/templates/html' ,
232
234
[d.file ('foo.html' , 'Text {{#b1}}Section{{/b1}}' )]),
233
235
],
234
- '_i1. Foo()..b1 = false' ,
236
+ 'Foo()..b1 = false' ,
235
237
);
236
238
expect (output, equals ('Text ' ));
237
239
});
@@ -242,7 +244,7 @@ void main() {
242
244
d.dir ('lib/templates/html' ,
243
245
[d.file ('foo.html' , 'Text {{#b1}}Section{{/b1}}' )]),
244
246
],
245
- '_i1. Foo()..b1 = false' ,
247
+ 'Foo()..b1 = false' ,
246
248
);
247
249
expect (output, equals ('Text ' ));
248
250
});
@@ -254,7 +256,7 @@ void main() {
254
256
d.dir ('lib/templates/html' ,
255
257
[d.file ('foo.html' , 'Text {{^b1}}Section{{/b1}}' )]),
256
258
],
257
- '_i1. Foo()..b1 = true' ,
259
+ 'Foo()..b1 = true' ,
258
260
);
259
261
expect (output, equals ('Text ' ));
260
262
});
@@ -265,7 +267,7 @@ void main() {
265
267
d.dir ('lib/templates/html' ,
266
268
[d.file ('foo.html' , 'Text {{^b1}}Section{{/b1}}' )]),
267
269
],
268
- '_i1. Foo()..b1 = false' ,
270
+ 'Foo()..b1 = false' ,
269
271
);
270
272
expect (output, equals ('Text Section' ));
271
273
});
@@ -276,7 +278,7 @@ void main() {
276
278
d.dir ('lib/templates/html' ,
277
279
[d.file ('foo.html' , 'Text {{#l1}}Num {{.}}, {{/l1}}' )]),
278
280
],
279
- '_i1. Foo()..l1 = [1, 2, 3]' ,
281
+ 'Foo()..l1 = [1, 2, 3]' ,
280
282
);
281
283
expect (output, equals ('Text Num 1, Num 2, Num 3, ' ));
282
284
});
@@ -288,7 +290,7 @@ void main() {
288
290
d.dir ('lib/templates/html' ,
289
291
[d.file ('bar.html' , 'Text {{#foo.l1}}Num {{.}}, {{/foo.l1}}' )]),
290
292
],
291
- '_i1. Bar()..foo = (_i1. Foo()..l1 = [1, 2, 3])' ,
293
+ 'Bar()..foo = (Foo()..l1 = [1, 2, 3])' ,
292
294
);
293
295
expect (output, equals ('Text Num 1, Num 2, Num 3, ' ));
294
296
});
@@ -299,7 +301,7 @@ void main() {
299
301
d.dir ('lib/templates/html' ,
300
302
[d.file ('foo.html' , 'Text {{#l1}}Num {{.}}, {{/l1}}' )]),
301
303
],
302
- '_i1. Foo()..l1 = []' ,
304
+ 'Foo()..l1 = []' ,
303
305
);
304
306
expect (output, equals ('Text ' ));
305
307
});
@@ -310,7 +312,7 @@ void main() {
310
312
d.dir ('lib/templates/html' ,
311
313
[d.file ('foo.html' , 'Text {{^l1}}Empty{{/l1}}' )]),
312
314
],
313
- '_i1. Foo()..l1 = []' ,
315
+ 'Foo()..l1 = []' ,
314
316
);
315
317
expect (output, equals ('Text Empty' ));
316
318
});
@@ -321,7 +323,7 @@ void main() {
321
323
d.dir ('lib/templates/html' ,
322
324
[d.file ('foo.html' , 'Text {{^l1}}Empty{{/l1}}' )]),
323
325
],
324
- '_i1. Foo()..l1 = [1, 2, 3]' ,
326
+ 'Foo()..l1 = [1, 2, 3]' ,
325
327
);
326
328
expect (output, equals ('Text ' ));
327
329
});
@@ -332,7 +334,7 @@ void main() {
332
334
d.dir ('lib/templates/html' ,
333
335
[d.file ('bar.html' , 'Text {{#foo}}Foo: {{s1}}{{/foo}}' )]),
334
336
],
335
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")' ,
337
+ 'Bar()..foo = (Foo()..s1 = "hello")' ,
336
338
);
337
339
expect (output, equals ('Text Foo: hello' ));
338
340
});
@@ -344,7 +346,7 @@ void main() {
344
346
d.dir ('lib/templates/html' ,
345
347
[d.file ('bar.html' , 'Text {{#foo}}One {{#s2}}Two{{/s2}}{{/foo}}' )]),
346
348
],
347
- '_i1. Bar()..foo = _i1. Foo()..s2 = "hello"' ,
349
+ 'Bar()..foo = Foo()..s2 = "hello"' ,
348
350
);
349
351
expect (output, equals ('Text One Two' ));
350
352
});
@@ -355,7 +357,7 @@ void main() {
355
357
d.dir ('lib/templates/html' ,
356
358
[d.file ('foo.html' , 'Text {{#s1}}"{{.}}" ({{length}}){{/s1}}' )]),
357
359
],
358
- '_i1. Foo()..s1 = null' ,
360
+ 'Foo()..s1 = null' ,
359
361
);
360
362
expect (output, equals ('Text ' ));
361
363
});
@@ -366,7 +368,7 @@ void main() {
366
368
d.dir ('lib/templates/html' ,
367
369
[d.file ('foo.html' , 'Text {{^s1}}Section{{/s1}}' )]),
368
370
],
369
- '_i1. Foo()..s1 = "hello"' ,
371
+ 'Foo()..s1 = "hello"' ,
370
372
);
371
373
expect (output, equals ('Text ' ));
372
374
});
@@ -377,7 +379,7 @@ void main() {
377
379
d.dir ('lib/templates/html' ,
378
380
[d.file ('foo.html' , 'Text {{^s1}}Section{{/s1}}' )]),
379
381
],
380
- '_i1. Foo()..s1 = null' ,
382
+ 'Foo()..s1 = null' ,
381
383
);
382
384
expect (output, equals ('Text Section' ));
383
385
});
@@ -388,7 +390,7 @@ void main() {
388
390
d.dir ('lib/templates/html' ,
389
391
[d.file ('bar.html' , 'Text {{#foo}}{{s1}}{{/foo}}' )]),
390
392
],
391
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")' ,
393
+ 'Bar()..foo = (Foo()..s1 = "hello")' ,
392
394
);
393
395
expect (output, equals ('Text hello' ));
394
396
});
@@ -400,7 +402,7 @@ void main() {
400
402
d.dir ('lib/templates/html' ,
401
403
[d.file ('bar.html' , 'Text {{#foo}}{{s2}}{{/foo}}' )]),
402
404
],
403
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")..s2 = "goodbye"' ,
405
+ 'Bar()..foo = (Foo()..s1 = "hello")..s2 = "goodbye"' ,
404
406
);
405
407
expect (output, equals ('Text goodbye' ));
406
408
});
@@ -410,7 +412,7 @@ void main() {
410
412
() => [
411
413
d.dir ('lib/templates/html' , [d.file ('bar.html' , 'Text {{foo.s1}}' )]),
412
414
],
413
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")..s2 = "goodbye"' ,
415
+ 'Bar()..foo = (Foo()..s1 = "hello")..s2 = "goodbye"' ,
414
416
);
415
417
expect (output, equals ('Text hello' ));
416
418
});
@@ -420,7 +422,7 @@ void main() {
420
422
() => [
421
423
d.dir ('lib/templates/html' , [d.file ('foo.html' , 'Text {{p1.p2.s}}' )]),
422
424
],
423
- '_i1. Foo()..p1 = (_i1. Property1()..p2 = (_i1. Property2()..s = "hello"))' ,
425
+ 'Foo()..p1 = (Property1()..p2 = (Property2()..s = "hello"))' ,
424
426
);
425
427
expect (output, equals ('Text hello' ));
426
428
});
@@ -432,9 +434,9 @@ void main() {
432
434
d.dir (
433
435
'lib/templates/html' , [d.file ('foo.html' , 'Text {{p1.p2.p3.s}}' )]),
434
436
],
435
- '_i1. Foo()'
436
- '..p1 = (_i1. Property1()'
437
- '..p2 = (_i1. Property2()..p3 = (_i1. Property3()..s = "hello")))' ,
437
+ 'Foo()'
438
+ '..p1 = (Property1()'
439
+ '..p2 = (Property2()..p3 = (Property3()..s = "hello")))' ,
438
440
);
439
441
expect (output, equals ('Text hello' ));
440
442
});
@@ -445,7 +447,7 @@ void main() {
445
447
d.dir ('lib/templates/html' ,
446
448
[d.file ('bar.html' , 'Text {{#foo}}{{foo.s1}}{{/foo}}' )]),
447
449
],
448
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")..s2 = "goodbye"' ,
450
+ 'Bar()..foo = (Foo()..s1 = "hello")..s2 = "goodbye"' ,
449
451
);
450
452
expect (output, equals ('Text hello' ));
451
453
});
@@ -456,7 +458,7 @@ void main() {
456
458
d.dir ('lib/templates/html' ,
457
459
[d.file ('baz.html' , 'Text {{#bar}}{{bar.foo.s1}}{{/bar}}' )]),
458
460
],
459
- '_i1. Baz()..bar = (_i1. Bar()..foo = (_i1. Foo()..s1 = "hello"))' ,
461
+ 'Baz()..bar = (Bar()..foo = (Foo()..s1 = "hello"))' ,
460
462
);
461
463
expect (output, equals ('Text hello' ));
462
464
});
@@ -469,7 +471,7 @@ void main() {
469
471
d.file ('baz.html' , 'Text {{#bar}}{{bar.foo.baz.bar.foo.s1}}{{/bar}}' )
470
472
]),
471
473
],
472
- '_i1. Baz()..bar = (_i1. Bar()..foo = (_i1. Foo()..s1 = "hello"));'
474
+ 'Baz()..bar = (Bar()..foo = (Foo()..s1 = "hello"));'
473
475
'baz.bar!.foo!.baz = baz' ,
474
476
);
475
477
expect (output, equals ('Text hello' ));
@@ -483,7 +485,7 @@ void main() {
483
485
d.file ('_foo.mustache.html' , 'Partial {{s1}}' ),
484
486
]),
485
487
],
486
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")' ,
488
+ 'Bar()..foo = (Foo()..s1 = "hello")' ,
487
489
);
488
490
expect (output, equals ('Text Partial hello' ));
489
491
});
@@ -498,7 +500,7 @@ void main() {
498
500
d.file ('_foo.mustache.html' , 'Partial {{s1}}' ),
499
501
]),
500
502
],
501
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")' ,
503
+ 'Bar()..foo = (Foo()..s1 = "hello")' ,
502
504
);
503
505
expect (output, equals ('Text Partial hello' ));
504
506
});
@@ -515,7 +517,7 @@ void main() {
515
517
d.file ('_foo.mustache.html' , 'Partial {{s2}}' ),
516
518
]),
517
519
],
518
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello")..s2 = "goodbye"' ,
520
+ 'Bar()..foo = (Foo()..s1 = "hello")..s2 = "goodbye"' ,
519
521
);
520
522
expect (output, equals ('Text Partial goodbye' ));
521
523
});
@@ -530,7 +532,7 @@ void main() {
530
532
d.file ('_foo_l1.mustache.html' , 'p2 {{.}}, ' ),
531
533
]),
532
534
],
533
- '_i1. Bar()..foo = (_i1. Foo()..s1 = "hello"..l1 = [1, 2, 3])' ,
535
+ 'Bar()..foo = (Foo()..s1 = "hello"..l1 = [1, 2, 3])' ,
534
536
);
535
537
expect (output, equals ('Text, p1, p2 1, p2 2, p2 3, ' ));
536
538
});
@@ -552,7 +554,7 @@ void main() {
552
554
() => [
553
555
d.dir ('lib/templates/html' , [d.file ('foo.html' , 'Text {{s2}}' )]),
554
556
],
555
- '_i1. Foo()' ,
557
+ 'Foo()' ,
556
558
),
557
559
throwsA (const TypeMatcher <MustachioResolutionError >()
558
560
.having ((e) => e.message, 'message' , contains ('''
@@ -571,7 +573,7 @@ line 1, column 8 of lib/templates/html/foo.html: Failed to resolve '[s2]' as a p
571
573
d.dir ('lib/templates/html' ,
572
574
[d.file ('foo.html' , 'Text {{#s2}}Section{{/s2}}' )]),
573
575
],
574
- '_i1. Foo()' ,
576
+ 'Foo()' ,
575
577
),
576
578
throwsA (const TypeMatcher <MustachioResolutionError >()
577
579
.having ((e) => e.message, 'message' , contains ('''
@@ -590,7 +592,7 @@ line 1, column 9 of lib/templates/html/foo.html: Failed to resolve '[s2]' as a p
590
592
() => [
591
593
d.dir ('lib/templates/html' , [d.file ('bar.html' , 'Text {{foo.x}}' )]),
592
594
],
593
- '_i1. Bar()..foo = _i1. Foo()' ,
595
+ 'Bar()..foo = Foo()' ,
594
596
),
595
597
throwsA (const TypeMatcher <MustachioResolutionError >()
596
598
.having ((e) => e.message, 'message' , contains ('''
@@ -610,7 +612,7 @@ line 1, column 8 of lib/templates/html/bar.html: Failed to resolve 'x' on Bar wh
610
612
d.dir ('lib/templates/html' ,
611
613
[d.file ('bar.html' , 'Text {{#foo.x}}Section{{/foo.x}}' )]),
612
614
],
613
- '_i1. Bar()..foo = _i1. Foo()' ,
615
+ 'Bar()..foo = Foo()' ,
614
616
),
615
617
throwsA (const TypeMatcher <MustachioResolutionError >()
616
618
.having ((e) => e.message, 'message' , contains ('''
@@ -634,7 +636,7 @@ line 1, column 13 of lib/templates/html/bar.html: Failed to resolve '[x]' as a p
634
636
d.file ('bar.html' , 'Text {{#foo}}{{>missing.mustache}}{{/foo}}' )
635
637
]),
636
638
],
637
- '_i1. Bar()' ,
639
+ 'Bar()' ,
638
640
),
639
641
throwsA (const TypeMatcher <PathNotFoundException >()),
640
642
);
0 commit comments