@@ -86,7 +86,7 @@ Future<void> _startServer(
8686 .transform (const LineSplitter ())
8787 .asBroadcastStream ();
8888
89- var stdErrLines =
89+ final stdErrLines =
9090 proc.stderr
9191 .transform (utf8.decoder)
9292 .transform (const LineSplitter ())
@@ -106,7 +106,7 @@ Future<void> stopServer({bool? cleanUp}) async {
106106 final process = _process;
107107 if (process != null ) {
108108 expect (process.kill (), true );
109- var exitCode = process.exitCode;
109+ final exitCode = process.exitCode;
110110 _process = null ;
111111 await exitCode;
112112 }
@@ -120,7 +120,7 @@ Future<void> stopServer({bool? cleanUp}) async {
120120/// Checks whether the current git client is "clean" (no pending changes) for
121121/// this package directory.
122122bool _gitIsClean () {
123- var gitStatus =
123+ final gitStatus =
124124 Process .runSync ('git' , ['status' , '.' , '--porcelain' ]).stdout as String ;
125125 return gitStatus.isEmpty;
126126}
@@ -131,7 +131,7 @@ bool _gitIsClean() {
131131/// This also calls `addTearDown` with a method that will reset the current git
132132/// state for this directory after running the test.
133133void ensureCleanGitClient () {
134- var gitWasClean = _gitIsClean ();
134+ final gitWasClean = _gitIsClean ();
135135 expect (
136136 gitWasClean,
137137 isTrue,
@@ -194,7 +194,7 @@ Future<TestProcess> _runTests(
194194}) async {
195195 usePrecompiled ?? = true ;
196196 if (usePrecompiled) {
197- var args =
197+ final args =
198198 scriptArgs.toList ()
199199 ..add ('test' )
200200 ..add ('--verbose' )
@@ -203,7 +203,7 @@ Future<TestProcess> _runTests(
203203 ..addAll ([...? testArgs, '-p' , 'chrome' , '-r' , 'expanded' ]);
204204 return TestProcess .start (executable, args);
205205 } else {
206- var args = ['run' , 'test' , '--pub-serve' , '8081' , ...? testArgs];
206+ final args = ['run' , 'test' , '--pub-serve' , '8081' , ...? testArgs];
207207 return TestProcess .start ('dart' , args);
208208 }
209209}
@@ -215,7 +215,7 @@ Future<void> expectTestsFail({
215215}) async {
216216 // Skip on Windows due to Chrome test flakiness, see
217217 // https://github.com/dart-lang/build/issues/4123.
218- var result = await runTests (
218+ final result = await runTests (
219219 usePrecompiled: usePrecompiled,
220220 buildArgs: buildArgs,
221221 testArgs: testArgs,
@@ -233,12 +233,12 @@ Future<void> expectTestsPass({
233233 // Skip on Windows due to Chrome test flakiness, see
234234 // https://github.com/dart-lang/build/issues/4123.
235235 if (Platform .isWindows) return ;
236- var result = await runTests (
236+ final result = await runTests (
237237 usePrecompiled: usePrecompiled,
238238 buildArgs: buildArgs,
239239 testArgs: testArgs,
240240 );
241- var allLines = await result.stdout.rest.toList ();
241+ final allLines = await result.stdout.rest.toList ();
242242 expect (allLines, contains (contains ('All tests passed!' )));
243243 if (expectedNumRan != null ) {
244244 expect (allLines, contains (contains ('+$expectedNumRan ' )));
@@ -248,27 +248,27 @@ Future<void> expectTestsPass({
248248}
249249
250250Future <void > createFile (String path, String contents) async {
251- var file = File (path);
251+ final file = File (path);
252252 expect (await file.exists (), isFalse);
253253 await file.create (recursive: true );
254254 await file.writeAsString (contents);
255255}
256256
257257Future <void > deleteFile (String path) async {
258- var file = File (path);
258+ final file = File (path);
259259 expect (await file.exists (), isTrue);
260260 await file.delete ();
261261}
262262
263263Future <String > readGeneratedFileAsString (String path) async {
264- var file = File (p.join (_generatedDir.path, path));
264+ final file = File (p.join (_generatedDir.path, path));
265265 expect (await file.exists (), isTrue);
266266 return file.readAsString ();
267267}
268268
269269Future <void > replaceAllInFile (String path, Pattern from, String replace) async {
270- var file = File (path);
270+ final file = File (path);
271271 expect (await file.exists (), isTrue);
272- var content = await file.readAsString ();
272+ final content = await file.readAsString ();
273273 await file.writeAsString (content.replaceAll (from, replace));
274274}
0 commit comments