Migrate features_tests and other tool tests to null safety (#80168)
This commit is contained in:
@@ -101,7 +101,7 @@ define("$bootstrapModule", ["$entrypoint", "dart_sdk"], function(app, dart_sdk)
|
||||
String generateTestEntrypoint({
|
||||
required String relativeTestPath,
|
||||
required String absolutePath,
|
||||
required String testConfigPath,
|
||||
required String? testConfigPath,
|
||||
required LanguageVersion languageVersion,
|
||||
}) {
|
||||
return '''
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:file_testing/file_testing.dart';
|
||||
import 'package:flutter_tools/src/base/common.dart';
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// 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:flutter_tools/src/base/async_guard.dart';
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/base/bot_detector.dart';
|
||||
import 'package:flutter_tools/src/base/io.dart';
|
||||
@@ -19,9 +17,9 @@ final Uri azureUrl = Uri.parse('http://169.254.169.254/metadata/instance');
|
||||
|
||||
void main() {
|
||||
group('BotDetector', () {
|
||||
FakePlatform fakePlatform;
|
||||
FakeStdio fakeStdio;
|
||||
PersistentToolState persistentToolState;
|
||||
late FakePlatform fakePlatform;
|
||||
late FakeStdio fakeStdio;
|
||||
late PersistentToolState persistentToolState;
|
||||
|
||||
setUp(() {
|
||||
fakePlatform = FakePlatform()..environment = <String, String>{};
|
||||
|
||||
@@ -2,20 +2,17 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/command_help.dart';
|
||||
import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/base/platform.dart';
|
||||
import 'package:flutter_tools/src/base/terminal.dart' show AnsiTerminal, OutputPreferences;
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
import '../../src/common.dart';
|
||||
import '../../src/fakes.dart';
|
||||
|
||||
CommandHelp _createCommandHelp({
|
||||
@required bool ansi,
|
||||
@required int wrapColumn,
|
||||
required bool ansi,
|
||||
required int wrapColumn,
|
||||
}) {
|
||||
final Platform platform = FakePlatform(
|
||||
stdoutSupportsAnsi: ansi,
|
||||
@@ -36,9 +33,9 @@ CommandHelp _createCommandHelp({
|
||||
|
||||
// Used to use the message length in different scenarios in a DRY way
|
||||
void _testMessageLength({
|
||||
@required bool stdoutSupportsAnsi,
|
||||
@required int maxTestLineLength,
|
||||
@required int wrapColumn,
|
||||
required bool stdoutSupportsAnsi,
|
||||
required int maxTestLineLength,
|
||||
required int wrapColumn,
|
||||
}) {
|
||||
final CommandHelp commandHelp = _createCommandHelp(
|
||||
ansi: stdoutSupportsAnsi,
|
||||
@@ -82,7 +79,7 @@ void main() {
|
||||
group('toString', () {
|
||||
testWithoutContext('ends with a resetBold when it has parenthetical text', () {
|
||||
final Platform platform = FakePlatform(stdoutSupportsAnsi: true);
|
||||
final AnsiTerminal terminal = AnsiTerminal(stdio: null, platform: platform);
|
||||
final AnsiTerminal terminal = AnsiTerminal(stdio: FakeStdio(), platform: platform);
|
||||
|
||||
final CommandHelpOption commandHelpOption = CommandHelpOption(
|
||||
'tester',
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/utils.dart';
|
||||
|
||||
import '../src/common.dart';
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/custom_devices/custom_device_workflow.dart';
|
||||
|
||||
import '../../src/common.dart';
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/config.dart';
|
||||
import 'package:flutter_tools/src/base/platform.dart';
|
||||
import 'package:flutter_tools/src/features.dart';
|
||||
@@ -14,16 +12,16 @@ import '../src/fakes.dart';
|
||||
|
||||
void main() {
|
||||
group('Features', () {
|
||||
Config testConfig;
|
||||
FakePlatform platform;
|
||||
FlutterFeatureFlags featureFlags;
|
||||
late Config testConfig;
|
||||
late FakePlatform platform;
|
||||
late FlutterFeatureFlags featureFlags;
|
||||
|
||||
setUp(() {
|
||||
testConfig = Config.test();
|
||||
platform = FakePlatform(environment: <String, String>{});
|
||||
|
||||
for (final Feature feature in allFeatures) {
|
||||
testConfig.setValue(feature.configSetting, false);
|
||||
testConfig.setValue(feature.configSetting!, false);
|
||||
}
|
||||
|
||||
featureFlags = FlutterFeatureFlags(
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/platform.dart';
|
||||
import 'package:flutter_tools/src/features.dart';
|
||||
import 'package:flutter_tools/src/linux/linux_workflow.dart';
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:file/memory.dart';
|
||||
import 'package:flutter_tools/src/base/file_system.dart';
|
||||
import 'package:flutter_tools/src/base/platform.dart';
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/web/bootstrap.dart';
|
||||
import 'package:package_config/package_config.dart';
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:file/memory.dart';
|
||||
@@ -30,9 +28,9 @@ void main() {
|
||||
final WebMemoryFS webMemoryFS = WebMemoryFS();
|
||||
webMemoryFS.write(source, manifest, sourcemap, metadata);
|
||||
|
||||
expect(utf8.decode(webMemoryFS.files['foo.js']), 'main() {}');
|
||||
expect(utf8.decode(webMemoryFS.sourcemaps['foo.js.map']), '{}');
|
||||
expect(utf8.decode(webMemoryFS.metadataFiles['foo.js.metadata']), '{}');
|
||||
expect(utf8.decode(webMemoryFS.files['foo.js']!), 'main() {}');
|
||||
expect(utf8.decode(webMemoryFS.sourcemaps['foo.js.map']!), '{}');
|
||||
expect(utf8.decode(webMemoryFS.metadataFiles['foo.js.metadata']!), '{}');
|
||||
expect(webMemoryFS.mergedMetadata, '{}');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/platform.dart';
|
||||
import 'package:flutter_tools/src/web/workflow.dart';
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// @dart = 2.8
|
||||
|
||||
import 'package:flutter_tools/src/base/platform.dart';
|
||||
import 'package:flutter_tools/src/windows/windows_workflow.dart';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user