Unnecessary new (#20138)

* enable lint unnecessary_new

* fix tests

* fix tests

* fix tests
This commit is contained in:
Alexandre Ardhuin
2018-09-12 08:29:29 +02:00
committed by GitHub
parent d7a0dcaa4a
commit d927c93310
1285 changed files with 26519 additions and 26519 deletions

View File

@@ -17,7 +17,7 @@ void main() {
setUp(() {
FakeDevice.resetLog();
device = null;
device = new FakeDevice();
device = FakeDevice();
});
tearDown(() {
@@ -115,7 +115,7 @@ CommandArgs cmd({
List<String> arguments,
Map<String, String> environment,
}) {
return new CommandArgs(
return CommandArgs(
command: command,
arguments: arguments,
environment: environment,
@@ -183,7 +183,7 @@ class FakeDevice extends AndroidDevice {
@override
Future<String> shellEval(String command, List<String> arguments, { Map<String, String> environment }) async {
commandLog.add(new CommandArgs(
commandLog.add(CommandArgs(
command: command,
arguments: arguments,
environment: environment,
@@ -193,7 +193,7 @@ class FakeDevice extends AndroidDevice {
@override
Future<Null> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
commandLog.add(new CommandArgs(
commandLog.add(CommandArgs(
command: command,
arguments: arguments,
environment: environment,

View File

@@ -11,4 +11,4 @@ export 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
// TODO(ianh): Remove this file once https://github.com/dart-lang/matcher/issues/98 is fixed
/// A matcher that compares the type of the actual value to the type argument T.
Matcher isInstanceOf<T>() => new test_package.TypeMatcher<T>(); // ignore: prefer_const_constructors, https://github.com/dart-lang/sdk/issues/32544
Matcher isInstanceOf<T>() => test_package.TypeMatcher<T>(); // ignore: prefer_const_constructors, https://github.com/dart-lang/sdk/issues/32544

View File

@@ -20,7 +20,7 @@ void main() {
expect(task.requiredAgentCapabilities, <String>['linux/android']);
for (ManifestTask task in manifest.tasks) {
final File taskFile = new File('bin/tasks/${task.name}.dart');
final File taskFile = File('bin/tasks/${task.name}.dart');
expect(taskFile.existsSync(), true,
reason: 'File ${taskFile.path} corresponding to manifest task "${task.name}" not found');
}

View File

@@ -13,7 +13,7 @@ void main() {
});
test('understands RegExp', () {
expect(grep(new RegExp('^b'), from: 'ab\nba'), <String>['ba']);
expect(grep(RegExp('^b'), from: 'ab\nba'), <String>['ba']);
});
});
}