@@ -11,20 +11,20 @@ void main() {
1111
1212 setUp (() {
1313 tester = InvalidationTester ();
14-
15- // Start with output source on disk.
16- //
17- // The ordering of sources matters because a different codepath in
18- // `graph.dart` is triggered depending on whether a source is first
19- // processed as an input or as a generated output of another input.
20- //
21- // So for `a` have the output come first, and for `b` the input come
22- // first.
23- tester.sources (['a.g' , 'a' , 'b' , 'b.g' ]);
2414 });
2515
2616 group ('a <== a.g, a <== a.other' , () {
2717 setUp (() {
18+ // Start with output source on disk.
19+ //
20+ // The ordering of sources matters because a different codepath in
21+ // `graph.dart` is triggered depending on whether a source is first
22+ // processed as an input or as a generated output of another input.
23+ //
24+ // So for `a` have the output come first, and for `b` the input come
25+ // first.
26+ tester.sources (['a.g' , 'a' , 'b' , 'b.g' ]);
27+
2828 tester.builder (from: '' , to: '.g' , outputIsVisible: true )
2929 ..reads ('' )
3030 ..writes ('.g' );
@@ -37,7 +37,7 @@ void main() {
3737 test ('checked in outputs are not treated as inputs' , () async {
3838 expect (
3939 await tester.build (),
40- // If outputs were treated by inputs there would be outputs created like
40+ // If outputs were treated as inputs there would be outputs created like
4141 // `a.g.g.other`.
4242 Result (
4343 written: [
@@ -52,4 +52,46 @@ void main() {
5252 );
5353 });
5454 });
55+
56+ group ('a <== a.g' , () {
57+ setUp (() {
58+ // Start with output source on disk that the build would not actually
59+ // write: with the output of a previous build used as input.
60+ //
61+ // The order matters because it affects the codepath in `graph.dart`.
62+ tester.sources (['a.g.g' , 'a.g' , 'a' ]);
63+
64+ tester.builder (from: '' , to: '.g' , outputIsVisible: true )
65+ ..reads ('' )
66+ ..writes ('.g' );
67+ });
68+
69+ test ('can ignore multiple level pregenerated output' , () async {
70+ expect (await tester.build (), Result (written: ['a.g' ]));
71+ });
72+ });
73+
74+ group ('a <== a.g <== a.g.other' , () {
75+ setUp (() {
76+ // Start with output source on disk that the build would not actually
77+ // write: with the output of a previous build used as input.
78+ //
79+ // The order matters because it affects the codepath in `graph.dart`.
80+ tester.sources (['a.g.other.g' , 'a.g.other' , 'a.g' , 'a' ]);
81+
82+ tester.builder (from: '' , to: '.g' , outputIsVisible: true )
83+ ..reads ('' )
84+ ..writes ('.g' );
85+ tester.builder (from: '.g' , to: '.g.other' , outputIsVisible: true )
86+ ..reads ('.g' )
87+ ..writes ('.g.other' );
88+ });
89+
90+ test (
91+ 'can ignore multiple level pregenerated output from two builders' ,
92+ () async {
93+ expect (await tester.build (), Result (written: ['a.g' , 'a.g.other' ]));
94+ },
95+ );
96+ });
5597}
0 commit comments