diff --git a/dwds/test/build/ensure_version_test.dart b/dwds/test/build/ensure_version_test.dart index 5b306a794..17bd18843 100644 --- a/dwds/test/build/ensure_version_test.dart +++ b/dwds/test/build/ensure_version_test.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. -// @dart = 2.9 - @TestOn('vm') import 'dart:io'; diff --git a/dwds/test/build/min_sdk_test.dart b/dwds/test/build/min_sdk_test.dart index c3676a544..8d7817f54 100644 --- a/dwds/test/build/min_sdk_test.dart +++ b/dwds/test/build/min_sdk_test.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. -// @dart = 2.9 - @TestOn('vm') @Skip('Intended to run in analyze stage on stable SDK only, see mono_pkg.yaml') import 'dart:io'; @@ -19,8 +17,9 @@ void main() { sdkVersion = Version(sdkVersion.major, sdkVersion.minor, 0); final sdkConstraint = VersionConstraint.compatibleWith(sdkVersion); - final pubspecSdkConstraint = pubspec.environment['sdk']; - expect(sdkConstraint.allowsAll(pubspecSdkConstraint), true, + final pubspecSdkConstraint = pubspec.environment?['sdk']; + expect(pubspecSdkConstraint, isNotNull); + expect(sdkConstraint.allowsAll(pubspecSdkConstraint!), true, reason: 'Min sdk constraint is outdated. Please update SDK constraint in ' 'pubspec to allow latest stable and backwards compatible versions.' diff --git a/dwds/test/extension_backend_test.dart b/dwds/test/extension_backend_test.dart index d4fc893ba..7d687255f 100644 --- a/dwds/test/extension_backend_test.dart +++ b/dwds/test/extension_backend_test.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. -// @dart = 2.9 - import 'dart:async'; import 'package:async/src/stream_queue.dart'; @@ -31,7 +29,7 @@ class MockSocketHandler implements SocketHandler { } void main() { - ExtensionBackend extensionBackend; + late ExtensionBackend extensionBackend; setUpAll(() async { extensionBackend = diff --git a/dwds/test/metadata/class_test.dart b/dwds/test/metadata/class_test.dart index 2e56ba0e8..2aa4daff7 100644 --- a/dwds/test/metadata/class_test.dart +++ b/dwds/test/metadata/class_test.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. -// @dart = 2.9 - import 'package:dwds/src/debugging/metadata/class.dart'; import 'package:test/test.dart'; diff --git a/dwds/test/objects_test.dart b/dwds/test/objects_test.dart index c0fdd7e23..821e60d5b 100644 --- a/dwds/test/objects_test.dart +++ b/dwds/test/objects_test.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. -// @dart = 2.9 - @TestOn('vm') import 'package:dwds/src/utilities/objects.dart'; import 'package:test/test.dart'; @@ -18,16 +16,18 @@ void main() { // or from a RemoteObject. final property = Property({'name': 'prop', 'value': exampleMap}); expect(property.rawValue, exampleMap); - expect(property.value.objectId, '1234'); - expect(property.value.value, 'abcd'); + final value = property.value!; + expect(value.objectId, '1234'); + expect(value.value, 'abcd'); expect(property.name, 'prop'); }); test('from a RemoteObject', () { final remoteObject = RemoteObject({'objectId': '1234', 'value': 'abcd'}); final property = Property({'name': 'prop', 'value': remoteObject}); expect(property.rawValue, remoteObject); - expect(property.value.objectId, '1234'); - expect(property.value.value, 'abcd'); + final value = property.value!; + expect(value.objectId, '1234'); + expect(value.value, 'abcd'); expect(property.name, 'prop'); }); diff --git a/dwds/test/readers/frontend_server_asset_reader_test.dart b/dwds/test/readers/frontend_server_asset_reader_test.dart index ddd05c929..4ee4be2eb 100644 --- a/dwds/test/readers/frontend_server_asset_reader_test.dart +++ b/dwds/test/readers/frontend_server_asset_reader_test.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. -// @dart = 2.9 - import 'dart:async'; import 'dart:io'; @@ -16,10 +14,10 @@ import '../fixtures/utilities.dart'; final packagesDir = p.relative('../fixtures/_test', from: p.current); void main() { - FrontendServerAssetReader assetReader; - Directory tempFixtures; - File jsonOriginal; - File mapOriginal; + late FrontendServerAssetReader assetReader; + late Directory tempFixtures; + late File jsonOriginal; + late File mapOriginal; Future createTempFixtures() async { final fixtures = p.join('test', 'fixtures'); diff --git a/dwds/test/sdk_configuration_test.dart b/dwds/test/sdk_configuration_test.dart index 39d7e0a6a..79c7ff734 100644 --- a/dwds/test/sdk_configuration_test.dart +++ b/dwds/test/sdk_configuration_test.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. -// @dart = 2.9 - @TestOn('vm') import 'dart:io'; @@ -34,7 +32,7 @@ void main() { }); group('Non-standard configuration', () { - Directory outputDir; + late Directory outputDir; setUp(() async { final systemTempDir = Directory.systemTemp; @@ -42,7 +40,7 @@ void main() { }); tearDown(() async { - await outputDir?.delete(recursive: true); + await outputDir.delete(recursive: true); }); test('Can validate existing configuration layout', () async { @@ -54,7 +52,7 @@ void main() { final librariesPath = p.join(librariesDir, 'libraries.json'); Directory(librariesDir).createSync(recursive: true); - File(defaultSdkConfiguration.librariesPath).copySync(librariesPath); + File(defaultSdkConfiguration.librariesPath!).copySync(librariesPath); final summariesDir = p.join(sdkDirectory, 'summaries'); final unsoundSdkSummaryPath = p.join(summariesDir, 'ddc_sdk.dill'); @@ -62,16 +60,16 @@ void main() { p.join(summariesDir, 'ddc_outline_sound.dill'); Directory(summariesDir).createSync(recursive: true); - File(defaultSdkConfiguration.unsoundSdkSummaryPath) + File(defaultSdkConfiguration.unsoundSdkSummaryPath!) .copySync(unsoundSdkSummaryPath); - File(defaultSdkConfiguration.soundSdkSummaryPath) + File(defaultSdkConfiguration.soundSdkSummaryPath!) .copySync(soundSdkSummaryPath); final workerDir = p.join(sdkDirectory, 'snapshots'); final compilerWorkerPath = p.join(workerDir, 'dartdevc.dart.snapshot'); Directory(workerDir).createSync(recursive: true); - File(defaultSdkConfiguration.compilerWorkerPath) + File(defaultSdkConfiguration.compilerWorkerPath!) .copySync(compilerWorkerPath); final sdkConfiguration = SdkConfiguration( @@ -118,7 +116,7 @@ void main() { }); group('SDK configuration', () { - MemoryFileSystem fs; + late MemoryFileSystem fs; final root = '/root'; final sdkDirectory = root; diff --git a/dwds/test/web/batched_stream_test.dart b/dwds/test/web/batched_stream_test.dart index 1ab818a72..694018db4 100644 --- a/dwds/test/web/batched_stream_test.dart +++ b/dwds/test/web/batched_stream_test.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. -// @dart = 2.9 - @Retry(0) import 'dart:async';