Add spaces after flow control statements (#126320)
This commit is contained in:
@@ -208,7 +208,7 @@ void main() {
|
||||
try {
|
||||
localFileSystem.systemTempDirectory;
|
||||
fail('expected tool exit');
|
||||
} on ToolExit catch(e) {
|
||||
} on ToolExit catch (e) {
|
||||
expect(e.message, 'Your system temp directory (/does_not_exist) does not exist. '
|
||||
'Did you set an invalid override in your environment? '
|
||||
'See issue https://github.com/flutter/flutter/issues/74042 for more context.'
|
||||
|
||||
@@ -506,13 +506,13 @@ void main() {
|
||||
final MemoryIOSink frontendServerStdIn = MemoryIOSink();
|
||||
Stream<List<int>> frontendServerStdOut() async* {
|
||||
int processed = 0;
|
||||
while(true) {
|
||||
while(frontendServerStdIn.writes.length == processed) {
|
||||
while (true) {
|
||||
while (frontendServerStdIn.writes.length == processed) {
|
||||
await Future<dynamic>.delayed(const Duration(milliseconds: 5));
|
||||
}
|
||||
|
||||
String? boundaryKey;
|
||||
while(processed < frontendServerStdIn.writes.length) {
|
||||
while (processed < frontendServerStdIn.writes.length) {
|
||||
final List<int> data = frontendServerStdIn.writes[processed];
|
||||
final String stringData = utf8.decode(data);
|
||||
if (stringData.startsWith('compile ')) {
|
||||
|
||||
@@ -1060,10 +1060,10 @@ dependencies:
|
||||
const String newPluginName = 'flutterEngine.getPlugins().add(new plugin1.UseNewEmbedding());';
|
||||
const String oldPluginName = 'abcplugin1.UseOldEmbedding.registerWith(shimPluginRegistry.registrarFor("abcplugin1.UseOldEmbedding"));';
|
||||
final String content = registrant.readAsStringSync();
|
||||
for(final String plugin in <String>[newPluginName,oldPluginName]) {
|
||||
for (final String plugin in <String>[newPluginName,oldPluginName]) {
|
||||
expect(content, contains(plugin));
|
||||
expect(content.split(plugin).first.trim().endsWith('try {'), isTrue);
|
||||
expect(content.split(plugin).last.trim().startsWith('} catch(Exception e) {'), isTrue);
|
||||
expect(content.split(plugin).last.trim().startsWith('} catch (Exception e) {'), isTrue);
|
||||
}
|
||||
}, overrides: <Type, Generator>{
|
||||
FileSystem: () => fs,
|
||||
|
||||
@@ -75,7 +75,7 @@ void main() {
|
||||
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
|
||||
final int vmServicePort = await getFreePort();
|
||||
int ddsPort = await getFreePort();
|
||||
while(ddsPort == vmServicePort) {
|
||||
while (ddsPort == vmServicePort) {
|
||||
ddsPort = await getFreePort();
|
||||
}
|
||||
// If both --dds-port and --vm-service-port are provided, --dds-port will be used by
|
||||
|
||||
@@ -357,11 +357,11 @@ PubspecEditor _setDartSDKVersionEditor(String version) {
|
||||
for (i++; i < lines.length; i++) {
|
||||
final String innerLine = lines[i];
|
||||
final String sdkLine = " sdk: '$version'";
|
||||
if(innerLine.isNotEmpty && !innerLine.startsWith(' ')) {
|
||||
if (innerLine.isNotEmpty && !innerLine.startsWith(' ')) {
|
||||
lines.insert(i, sdkLine);
|
||||
break;
|
||||
}
|
||||
if(innerLine.startsWith(' sdk:')) {
|
||||
if (innerLine.startsWith(' sdk:')) {
|
||||
lines[i] = sdkLine;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ Future<void> expectToolExitLater(Future<dynamic> future, Matcher messageMatcher)
|
||||
try {
|
||||
await future;
|
||||
fail('ToolExit expected, but nothing thrown');
|
||||
} on ToolExit catch(e) {
|
||||
} on ToolExit catch (e) {
|
||||
expect(e.message, messageMatcher);
|
||||
// Catch all exceptions to give a better test failure message.
|
||||
} catch (e, trace) { // ignore: avoid_catches_without_on_clauses
|
||||
|
||||
@@ -230,7 +230,7 @@ class FakePollingDeviceDiscovery extends PollingDeviceDiscovery {
|
||||
}
|
||||
|
||||
void setDevices(List<Device> devices) {
|
||||
while(_devices.isNotEmpty) {
|
||||
while (_devices.isNotEmpty) {
|
||||
_removeDevice(_devices.first);
|
||||
}
|
||||
devices.forEach(addDevice);
|
||||
|
||||
Reference in New Issue
Block a user