@@ -53,6 +53,47 @@ void main() {
5353 ]));
5454 });
5555
56+ test ('skips flutter pub get for examples' , () async {
57+ final Directory plugin1Dir = createFakePlugin ('a' , withSingleExample: true );
58+
59+ final MockProcess mockProcess = MockProcess ();
60+ mockProcess.exitCodeCompleter.complete (0 );
61+ processRunner.processToReturn = mockProcess;
62+ await runner.run (< String > ['analyze' ]);
63+
64+ expect (
65+ processRunner.recordedCalls,
66+ orderedEquals (< ProcessCall > [
67+ ProcessCall (
68+ 'flutter' , const < String > ['packages' , 'get' ], plugin1Dir.path),
69+ ProcessCall ('dart' , const < String > ['analyze' , '--fatal-infos' ],
70+ plugin1Dir.path),
71+ ]));
72+ });
73+
74+ test ('don\' t elide a non-contained example package' , () async {
75+ final Directory plugin1Dir = createFakePlugin ('a' );
76+ final Directory plugin2Dir = createFakePlugin ('example' );
77+
78+ final MockProcess mockProcess = MockProcess ();
79+ mockProcess.exitCodeCompleter.complete (0 );
80+ processRunner.processToReturn = mockProcess;
81+ await runner.run (< String > ['analyze' ]);
82+
83+ expect (
84+ processRunner.recordedCalls,
85+ orderedEquals (< ProcessCall > [
86+ ProcessCall (
87+ 'flutter' , const < String > ['packages' , 'get' ], plugin1Dir.path),
88+ ProcessCall (
89+ 'flutter' , const < String > ['packages' , 'get' ], plugin2Dir.path),
90+ ProcessCall ('dart' , const < String > ['analyze' , '--fatal-infos' ],
91+ plugin1Dir.path),
92+ ProcessCall ('dart' , const < String > ['analyze' , '--fatal-infos' ],
93+ plugin2Dir.path),
94+ ]));
95+ });
96+
5697 test ('uses a separate analysis sdk' , () async {
5798 final Directory pluginDir = createFakePlugin ('a' );
5899
0 commit comments