format parameter list (#27261)
This commit is contained in:
committed by
GitHub
parent
1c021506df
commit
5169ab5974
@@ -68,7 +68,7 @@ String getFlutterRoot() {
|
||||
return fs.path.normalize(fs.path.join(toolsPath, '..', '..'));
|
||||
}
|
||||
|
||||
CommandRunner<void> createTestCommandRunner([FlutterCommand command]) {
|
||||
CommandRunner<void> createTestCommandRunner([ FlutterCommand command ]) {
|
||||
final FlutterCommandRunner runner = FlutterCommandRunner();
|
||||
if (command != null)
|
||||
runner.addCommand(command);
|
||||
@@ -76,15 +76,17 @@ CommandRunner<void> createTestCommandRunner([FlutterCommand command]) {
|
||||
}
|
||||
|
||||
/// Updates [path] to have a modification time [seconds] from now.
|
||||
void updateFileModificationTime(String path,
|
||||
DateTime baseTime,
|
||||
int seconds) {
|
||||
void updateFileModificationTime(
|
||||
String path,
|
||||
DateTime baseTime,
|
||||
int seconds,
|
||||
) {
|
||||
final DateTime modificationTime = baseTime.add(Duration(seconds: seconds));
|
||||
fs.file(path).setLastModifiedSync(modificationTime);
|
||||
}
|
||||
|
||||
/// Matcher for functions that throw [ToolExit].
|
||||
Matcher throwsToolExit({int exitCode, Pattern message}) {
|
||||
Matcher throwsToolExit({ int exitCode, Pattern message }) {
|
||||
Matcher matcher = isToolExit;
|
||||
if (exitCode != null)
|
||||
matcher = allOf(matcher, (ToolExit e) => e.exitCode == exitCode);
|
||||
@@ -97,7 +99,7 @@ Matcher throwsToolExit({int exitCode, Pattern message}) {
|
||||
final Matcher isToolExit = isInstanceOf<ToolExit>();
|
||||
|
||||
/// Matcher for functions that throw [ProcessExit].
|
||||
Matcher throwsProcessExit([dynamic exitCode]) {
|
||||
Matcher throwsProcessExit([ dynamic exitCode ]) {
|
||||
return exitCode == null
|
||||
? throwsA(isProcessExit)
|
||||
: throwsA(allOf(isProcessExit, (ProcessExit e) => e.exitCode == exitCode));
|
||||
@@ -109,7 +111,7 @@ final Matcher isProcessExit = isInstanceOf<ProcessExit>();
|
||||
/// Creates a flutter project in the [temp] directory using the
|
||||
/// [arguments] list if specified, or `--no-pub` if not.
|
||||
/// Returns the path to the flutter project.
|
||||
Future<String> createProject(Directory temp, {List<String> arguments}) async {
|
||||
Future<String> createProject(Directory temp, { List<String> arguments }) async {
|
||||
arguments ??= <String>['--no-pub'];
|
||||
final String projectPath = fs.path.join(temp.path, 'flutter_project');
|
||||
final CreateCommand command = CreateCommand();
|
||||
|
||||
@@ -38,7 +38,9 @@ MockDoctor get testDoctor => context[Doctor];
|
||||
typedef ContextInitializer = void Function(AppContext testContext);
|
||||
|
||||
@isTest
|
||||
void testUsingContext(String description, dynamic testMethod(), {
|
||||
void testUsingContext(
|
||||
String description,
|
||||
dynamic testMethod(), {
|
||||
Timeout timeout,
|
||||
Map<Type, Generator> overrides = const <Type, Generator>{},
|
||||
bool initializeFlutterRoot = true,
|
||||
|
||||
@@ -268,12 +268,12 @@ class MemoryIOSink implements IOSink {
|
||||
}
|
||||
|
||||
@override
|
||||
void writeln([Object obj = '']) {
|
||||
void writeln([ Object obj = '' ]) {
|
||||
add(encoding.encode('$obj\n'));
|
||||
}
|
||||
|
||||
@override
|
||||
void writeAll(Iterable<dynamic> objects, [String separator = '']) {
|
||||
void writeAll(Iterable<dynamic> objects, [ String separator = '' ]) {
|
||||
bool addSeparator = false;
|
||||
for (dynamic object in objects) {
|
||||
if (addSeparator) {
|
||||
@@ -285,7 +285,7 @@ class MemoryIOSink implements IOSink {
|
||||
}
|
||||
|
||||
@override
|
||||
void addError(dynamic error, [StackTrace stackTrace]) {
|
||||
void addError(dynamic error, [ StackTrace stackTrace ]) {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@@ -482,7 +482,7 @@ class MockResidentCompiler extends BasicMock implements ResidentCompiler {
|
||||
return null;
|
||||
}
|
||||
@override
|
||||
Future<CompilerOutput> recompile(String mainPath, List<String> invalidatedFiles, {String outputPath, String packagesFilePath}) async {
|
||||
Future<CompilerOutput> recompile(String mainPath, List<String> invalidatedFiles, { String outputPath, String packagesFilePath }) async {
|
||||
fs.file(outputPath).createSync(recursive: true);
|
||||
fs.file(outputPath).writeAsStringSync('compiled_kernel_output');
|
||||
return CompilerOutput(outputPath, 0);
|
||||
|
||||
Reference in New Issue
Block a user