Unnecessary new (#20138)
* enable lint unnecessary_new * fix tests * fix tests * fix tests
This commit is contained in:
committed by
GitHub
parent
d7a0dcaa4a
commit
d927c93310
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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']);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user