some formatting of map, parameters and spaces (#29760)
This commit is contained in:
committed by
GitHub
parent
ecfdd7e1ea
commit
bfa1d25bf9
@@ -35,7 +35,7 @@ void main() {
|
||||
artifacts.getArtifactPath(Artifact.flutterTester),
|
||||
fs.path.join(tempDir.path, 'bin', 'cache', 'artifacts', 'engine', 'linux-x64', 'flutter_tester'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Cache: () => Cache(rootOverride: tempDir),
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
@@ -53,7 +53,7 @@ void main() {
|
||||
artifacts.getEngineType(TargetPlatform.darwin_x64),
|
||||
'darwin-x64',
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Cache: () => Cache(rootOverride: tempDir),
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
@@ -89,7 +89,7 @@ void main() {
|
||||
artifacts.getArtifactPath(Artifact.engineDartSdkPath),
|
||||
fs.path.join(tempDir.path, 'out', 'host_debug_unopt', 'dart-sdk'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ void main() {
|
||||
artifacts.getEngineType(TargetPlatform.darwin_x64),
|
||||
'android_debug_unopt',
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: () => FakePlatform(operatingSystem: 'linux'),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ void main() {
|
||||
r'\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Oooh, I do I do I do\n$'));
|
||||
expect(mockLogger.traceText, '');
|
||||
expect(mockLogger.errorText, matches( r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Helpless!\n$'));
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: false),
|
||||
Platform: _kNoAnsiPlatform,
|
||||
});
|
||||
@@ -57,7 +57,7 @@ void main() {
|
||||
expect(
|
||||
mockLogger.errorText,
|
||||
matches('^$red' r'\[ (?: {0,2}\+[0-9]{1,3} ms| )\] ' '${bold}Helpless!$resetBold$resetColor' r'\n$'));
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ void main() {
|
||||
// rwxr--r--
|
||||
expect(mode.substring(0, 3), endsWith('x'));
|
||||
}
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OperatingSystemUtils: () => OperatingSystemUtils(),
|
||||
});
|
||||
});
|
||||
|
||||
@@ -44,7 +44,7 @@ void main() {
|
||||
equals('${AnsiTerminal.colorCode(color)}output${AnsiTerminal.resetColor}'),
|
||||
);
|
||||
}
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -54,7 +54,7 @@ void main() {
|
||||
terminal.bolden('output'),
|
||||
equals('${AnsiTerminal.bold}output${AnsiTerminal.resetBold}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -68,7 +68,7 @@ void main() {
|
||||
terminal.color('non-bold ${terminal.bolden('output')} also non-bold', TerminalColor.blue),
|
||||
equals('${AnsiTerminal.blue}non-bold ${AnsiTerminal.bold}output${AnsiTerminal.resetBold} also non-bold${AnsiTerminal.resetColor}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -82,7 +82,7 @@ void main() {
|
||||
terminal.bolden('non-color ${terminal.color('output', TerminalColor.blue)} also non-color'),
|
||||
equals('${AnsiTerminal.bold}non-color ${AnsiTerminal.blue}output${AnsiTerminal.resetColor} also non-color${AnsiTerminal.resetBold}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -96,7 +96,7 @@ void main() {
|
||||
terminal.color('magenta ${terminal.color('output', TerminalColor.blue)} also magenta', TerminalColor.magenta),
|
||||
equals('${AnsiTerminal.magenta}magenta ${AnsiTerminal.blue}output${AnsiTerminal.resetColor}${AnsiTerminal.magenta} also magenta${AnsiTerminal.resetColor}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
@@ -110,7 +110,7 @@ void main() {
|
||||
terminal.bolden('bold ${terminal.bolden('output')} still bold'),
|
||||
equals('${AnsiTerminal.bold}bold output still bold${AnsiTerminal.resetBold}'),
|
||||
);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
OutputPreferences: () => OutputPreferences(showColor: true),
|
||||
Platform: () => FakePlatform()..stdoutSupportsAnsi = true,
|
||||
});
|
||||
|
||||
@@ -9,12 +9,10 @@ import 'src/common.dart';
|
||||
import 'src/context.dart';
|
||||
|
||||
void main() {
|
||||
setUpAll(() {
|
||||
});
|
||||
setUpAll(() { });
|
||||
|
||||
group('Validate build number', () {
|
||||
setUp(() async {
|
||||
});
|
||||
setUp(() async { });
|
||||
|
||||
testUsingContext('CFBundleVersion for iOS', () async {
|
||||
String buildName = validatedBuildNumberForPlatform(TargetPlatform.ios, 'xyz');
|
||||
@@ -34,8 +32,7 @@ void main() {
|
||||
});
|
||||
|
||||
group('Validate build name', () {
|
||||
setUp(() async {
|
||||
});
|
||||
setUp(() async { });
|
||||
|
||||
testUsingContext('CFBundleShortVersionString for iOS', () async {
|
||||
String buildName = validatedBuildNameForPlatform(TargetPlatform.ios, 'xyz');
|
||||
|
||||
@@ -24,7 +24,7 @@ import '../src/context.dart';
|
||||
const String frameworkRevision = '12345678';
|
||||
const String frameworkChannel = 'omega';
|
||||
final Generator _kNoColorTerminalPlatform = () => FakePlatform.fromPlatform(const LocalPlatform())..stdoutSupportsAnsi = false;
|
||||
final Map<Type, Generator> noColorTerminalOverride = <Type, Generator> {
|
||||
final Map<Type, Generator> noColorTerminalOverride = <Type, Generator>{
|
||||
Platform: _kNoColorTerminalPlatform,
|
||||
};
|
||||
const String samplesIndexJson = '''[
|
||||
@@ -900,7 +900,7 @@ void main() {
|
||||
final List<String> args = <String>[
|
||||
'create',
|
||||
'--list-samples',
|
||||
outputFile
|
||||
outputFile,
|
||||
];
|
||||
|
||||
await runner.run(args);
|
||||
@@ -918,7 +918,7 @@ void main() {
|
||||
final List<String> args = <String>[
|
||||
'create',
|
||||
'--list-samples',
|
||||
outputFile
|
||||
outputFile,
|
||||
];
|
||||
|
||||
await expectLater(runner.run(args), throwsToolExit(exitCode: 2, message: 'Failed to write samples'));
|
||||
|
||||
@@ -123,7 +123,7 @@ void main() {
|
||||
notifyingLogger: notifyingLogger,
|
||||
);
|
||||
|
||||
commands.add(<String, dynamic>{ 'id': 0, 'method': 'app.restart' });
|
||||
commands.add(<String, dynamic>{'id': 0, 'method': 'app.restart'});
|
||||
final Map<String, dynamic> response = await responses.stream.firstWhere(_notEvent);
|
||||
expect(response['id'], 0);
|
||||
expect(response['error'], contains('appId is required'));
|
||||
@@ -147,7 +147,7 @@ void main() {
|
||||
commands.add(<String, dynamic>{
|
||||
'id': 0,
|
||||
'method': 'app.callServiceExtension',
|
||||
'params': <String, String> {
|
||||
'params': <String, String>{
|
||||
'methodName': 'ext.flutter.debugPaint',
|
||||
},
|
||||
});
|
||||
@@ -171,7 +171,7 @@ void main() {
|
||||
notifyingLogger: notifyingLogger,
|
||||
);
|
||||
|
||||
commands.add(<String, dynamic>{ 'id': 0, 'method': 'app.stop' });
|
||||
commands.add(<String, dynamic>{'id': 0, 'method': 'app.stop'});
|
||||
final Map<String, dynamic> response = await responses.stream.firstWhere(_notEvent);
|
||||
expect(response['id'], 0);
|
||||
expect(response['error'], contains('appId is required'));
|
||||
@@ -258,7 +258,7 @@ void main() {
|
||||
notifyingLogger: notifyingLogger,
|
||||
);
|
||||
|
||||
commands.add(<String, dynamic>{ 'id': 0, 'method': 'emulator.launch' });
|
||||
commands.add(<String, dynamic>{'id': 0, 'method': 'emulator.launch'});
|
||||
final Map<String, dynamic> response = await responses.stream.firstWhere(_notEvent);
|
||||
expect(response['id'], 0);
|
||||
expect(response['error'], contains('emulatorId is required'));
|
||||
|
||||
@@ -108,12 +108,14 @@ class MockProcessManager extends Mock implements ProcessManager {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Process> start(List<dynamic> command,
|
||||
{String workingDirectory,
|
||||
Map<String, String> environment,
|
||||
bool includeParentEnvironment = true,
|
||||
bool runInShell = false,
|
||||
ProcessStartMode mode = ProcessStartMode.normal}) {
|
||||
Future<Process> start(
|
||||
List<dynamic> command, {
|
||||
String workingDirectory,
|
||||
Map<String, String> environment,
|
||||
bool includeParentEnvironment = true,
|
||||
bool runInShell = false,
|
||||
ProcessStartMode mode = ProcessStartMode.normal,
|
||||
}) {
|
||||
final Completer<Process> completer = Completer<Process>();
|
||||
completer.complete(MockProcess());
|
||||
return completer.future;
|
||||
|
||||
@@ -532,9 +532,12 @@ Future<void> _recompile(
|
||||
mockFrontendServerStdIn._stdInWrites.clear();
|
||||
}
|
||||
|
||||
Future<void> _accept(StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator, MockStdIn mockFrontendServerStdIn,
|
||||
String expected) async {
|
||||
Future<void> _accept(
|
||||
StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator,
|
||||
MockStdIn mockFrontendServerStdIn,
|
||||
String expected,
|
||||
) async {
|
||||
// Put content into the output stream after generator.recompile gets
|
||||
// going few lines below, resets completer.
|
||||
generator.accept();
|
||||
@@ -544,9 +547,13 @@ Future<void> _accept(StreamController<List<int>> streamController,
|
||||
mockFrontendServerStdIn._stdInWrites.clear();
|
||||
}
|
||||
|
||||
Future<void> _reject(StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator, MockStdIn mockFrontendServerStdIn,
|
||||
String mockCompilerOutput, String expected) async {
|
||||
Future<void> _reject(
|
||||
StreamController<List<int>> streamController,
|
||||
ResidentCompiler generator,
|
||||
MockStdIn mockFrontendServerStdIn,
|
||||
String mockCompilerOutput,
|
||||
String expected,
|
||||
) async {
|
||||
// Put content into the output stream after generator.recompile gets
|
||||
// going few lines below, resets completer.
|
||||
scheduleMicrotask(() {
|
||||
|
||||
@@ -151,7 +151,7 @@ void main() {
|
||||
'version': 'test-version',
|
||||
},
|
||||
));
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Platform: () => FakePlatform(
|
||||
operatingSystem: 'linux',
|
||||
environment: <String, String>{
|
||||
|
||||
@@ -237,7 +237,7 @@ void main() {
|
||||
];
|
||||
await HotRunner(devices).cleanupAfterSignal();
|
||||
expect(shutdownTestingConfig.shutdownHookCalled, true);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => mockArtifacts,
|
||||
HotRunnerConfig: () => shutdownTestingConfig,
|
||||
});
|
||||
@@ -252,7 +252,7 @@ void main() {
|
||||
];
|
||||
await HotRunner(devices).preStop();
|
||||
expect(shutdownTestingConfig.shutdownHookCalled, true);
|
||||
}, overrides: <Type, Generator> {
|
||||
}, overrides: <Type, Generator>{
|
||||
Artifacts: () => mockArtifacts,
|
||||
HotRunnerConfig: () => shutdownTestingConfig,
|
||||
});
|
||||
|
||||
@@ -146,7 +146,7 @@ void main() {
|
||||
expect(testLogger.statusText, contains('iPhone Developer: Profile 1 (1111AAAA11)'));
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '3333CCCC33'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '3333CCCC33'});
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -217,7 +217,7 @@ void main() {
|
||||
);
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
|
||||
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
||||
},
|
||||
@@ -288,7 +288,7 @@ void main() {
|
||||
);
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '5555EEEE55'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '5555EEEE55'});
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -360,7 +360,7 @@ void main() {
|
||||
);
|
||||
expect(testLogger.errorText, isEmpty);
|
||||
verify(mockOpenSslStdIn.write('This is a mock certificate'));
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
ProcessManager: () => mockProcessManager,
|
||||
@@ -432,7 +432,7 @@ void main() {
|
||||
testLogger.statusText,
|
||||
contains('Certificate choice "iPhone Developer: Profile 3 (3333CCCC33)"'),
|
||||
);
|
||||
expect(signingConfigs, <String, String> {'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
expect(signingConfigs, <String, String>{'DEVELOPMENT_TEAM': '4444DDDD44'});
|
||||
verify(config.setValue('ios-signing-cert', 'iPhone Developer: Profile 3 (3333CCCC33)'));
|
||||
},
|
||||
overrides: <Type, Generator>{
|
||||
|
||||
@@ -403,11 +403,12 @@ void main() {
|
||||
expect(GitTagVersion.parse('v1.2.3-4-gx$hash').frameworkVersionFor(hash), '0.0.0-unknown');
|
||||
expect(testLogger.statusText, '');
|
||||
expect(testLogger.errorText, '');
|
||||
expect(testLogger.traceText,
|
||||
expect(
|
||||
testLogger.traceText,
|
||||
'Could not interpret results of "git describe": x1.2.3-4-gabcdef\n'
|
||||
'Could not interpret results of "git describe": v1.0.0-unknown-0-gabcdef\n'
|
||||
'Could not interpret results of "git describe": beta-1-gabcdef\n'
|
||||
'Could not interpret results of "git describe": v1.2.3-4-gxabcdef\n'
|
||||
'Could not interpret results of "git describe": v1.2.3-4-gxabcdef\n',
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user