From 19b45e46cd70a92ecd708a3d257d1edc2bb99004 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Mon, 11 Jul 2022 15:44:51 -0700 Subject: [PATCH 1/2] Migrate some test fixtures to null-safety --- dwds/test/fixtures/debugger_data.dart | 2 +- dwds/test/fixtures/logging.dart | 10 +++++----- dwds/test/fixtures/utilities.dart | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dwds/test/fixtures/debugger_data.dart b/dwds/test/fixtures/debugger_data.dart index 27f2284bd..65b70ec80 100644 --- a/dwds/test/fixtures/debugger_data.dart +++ b/dwds/test/fixtures/debugger_data.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// @dart = 2.9 + /// Contains hard-coded test data usable for tests. import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; diff --git a/dwds/test/fixtures/logging.dart b/dwds/test/fixtures/logging.dart index 26004c9a4..ea30d95e9 100644 --- a/dwds/test/fixtures/logging.dart +++ b/dwds/test/fixtures/logging.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// @dart = 2.9 + import 'dart:async'; @@ -10,9 +10,9 @@ import 'package:logging/logging.dart'; import 'package:test/test.dart'; typedef LogWriter = void Function(Level level, String message, - {String error, String loggerName, String stackTrace}); + {String? error, String? loggerName, String? stackTrace}); -StreamSubscription _loggerSub; +StreamSubscription? _loggerSub; /// Redirect the logs for the current zone to emit on failure. /// @@ -49,7 +49,7 @@ void setCurrentLogWriter({bool debug = false}) => /// /// Tests and groups of tests can use this to configure individual /// log writers on setup. -void configureLogWriter({LogWriter customLogWriter}) { +void configureLogWriter({LogWriter? customLogWriter}) { _logWriter = customLogWriter ?? _logWriter; Logger.root.level = Level.ALL; _loggerSub?.cancel(); @@ -69,7 +69,7 @@ void stopLogWriter() { LogWriter _logWriter = createLogWriter(); LogWriter createLogWriter({bool debug = false}) => - (level, message, {String error, String loggerName, String stackTrace}) { + (level, message, {String? error, String? loggerName, String? stackTrace}) { final printFn = debug ? print : printOnFailure; final errorMessage = error == null ? '' : ':\n$error'; final stackMessage = stackTrace == null ? '' : ':\n$stackTrace'; diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart index 8d995efc8..e4cc69b2d 100644 --- a/dwds/test/fixtures/utilities.dart +++ b/dwds/test/fixtures/utilities.dart @@ -2,7 +2,7 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -// @dart = 2.9 + import 'dart:io'; From 0beca2cc6c095ba68a9b9f8ef86987f264c83c70 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Mon, 11 Jul 2022 15:49:20 -0700 Subject: [PATCH 2/2] Dart format --- dwds/test/fixtures/debugger_data.dart | 2 -- dwds/test/fixtures/logging.dart | 2 -- dwds/test/fixtures/utilities.dart | 2 -- 3 files changed, 6 deletions(-) diff --git a/dwds/test/fixtures/debugger_data.dart b/dwds/test/fixtures/debugger_data.dart index 65b70ec80..5577acc1f 100644 --- a/dwds/test/fixtures/debugger_data.dart +++ b/dwds/test/fixtures/debugger_data.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - - /// Contains hard-coded test data usable for tests. import 'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'; diff --git a/dwds/test/fixtures/logging.dart b/dwds/test/fixtures/logging.dart index ea30d95e9..9c851e4c2 100644 --- a/dwds/test/fixtures/logging.dart +++ b/dwds/test/fixtures/logging.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - - import 'dart:async'; import 'package:logging/logging.dart'; diff --git a/dwds/test/fixtures/utilities.dart b/dwds/test/fixtures/utilities.dart index e4cc69b2d..8d0857338 100644 --- a/dwds/test/fixtures/utilities.dart +++ b/dwds/test/fixtures/utilities.dart @@ -2,8 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. - - import 'dart:io'; import 'package:build_daemon/client.dart';