Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Minor type, formatting fixes for 2.0.0-dev.64.1 (#224)
Browse files Browse the repository at this point in the history
* Eliminate use of deprecated Dart 1 constants. 
* Update to more recent package:args.
* Update to dartfmt from 2.0.0-dev.65.0.
  • Loading branch information
cbracken committed Jun 26, 2018
1 parent 926c04b commit ca241a7
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
3 changes: 1 addition & 2 deletions bin/format_coverage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ Environment parseArgs(List<String> arguments) {
parser.addOption('in', abbr: 'i', help: 'input(s): may be file or directory');
parser.addOption('out',
abbr: 'o', defaultsTo: 'stdout', help: 'output: may be file or stdout');
parser.addOption('report-on',
allowMultiple: true,
parser.addMultiOption('report-on',
help: 'which directories or files to report coverage on');
parser.addOption('workers',
abbr: 'j', defaultsTo: '1', help: 'number of workers');
Expand Down
4 changes: 2 additions & 2 deletions lib/src/collect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Future<List<Map<String, dynamic>>> _getCoverageJson(
VMServiceClient service, VMSourceReport report) async {
var scriptRefs = report.ranges.map((r) => r.script).toSet();
var scripts = <Uri, VMScript>{};
for (var script in await Future
.wait<VMScript>(scriptRefs.map((ref) => ref.load()).toList())) {
for (var script in await Future.wait<VMScript>(
scriptRefs.map((ref) => ref.load()).toList())) {
scripts[script.uri] = script;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/resolver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Resolver {
String resolveSymbolicLinks(String path) {
var normalizedPath = p.normalize(path);
var type = FileSystemEntity.typeSync(normalizedPath, followLinks: true);
if (type == FileSystemEntityType.NOT_FOUND) return null;
if (type == FileSystemEntityType.notFound) return null;
return new File(normalizedPath).resolveSymbolicLinksSync();
}

Expand Down
6 changes: 3 additions & 3 deletions lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ Future<int> getOpenPort() async {
ServerSocket socket;

try {
socket = await ServerSocket.bind(InternetAddress.LOOPBACK_IP_V4, 0);
socket = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
} catch (_) {
// try again v/ V6 only. Slight possibility that V4 is disabled
socket = await ServerSocket.bind(InternetAddress.LOOPBACK_IP_V6, 0,
v6Only: true);
socket =
await ServerSocket.bind(InternetAddress.loopbackIPv6, 0, v6Only: true);
}

try {
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: coverage
version: 0.12.0
version: 0.12.1
author: Dart Team <misc@dartlang.org>
description: Coverage data manipulation and formatting
homepage: https://github.com/dart-lang/coverage
environment:
sdk: '>=2.0.0-dev.64.1 <2.0.0'
dependencies:
args: '>=1.0.0 <2.0.0'
args: '>=1.4.0 <2.0.0'
logging: '>=0.9.0 <0.12.0'
package_config: ">=0.1.5 <2.0.0"
path: '>=0.9.0 <2.0.0'
Expand Down
3 changes: 2 additions & 1 deletion test/collect_coverage_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ void main() {
List coverage = jsonResult['coverage'];
expect(coverage, isNotEmpty);

var sources = coverage.fold({}, (Map map, value) {
var sources = coverage.fold<Map<String, dynamic>>(<String, dynamic>{},
(Map<String, dynamic> map, dynamic value) {
String sourceUri = value['source'];
map.putIfAbsent(sourceUri, () => <Map>[]).add(value);
return map;
Expand Down
3 changes: 2 additions & 1 deletion test/run_and_collect_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ void main() {
List<Map> coverage = json['coverage'];
expect(coverage, isNotEmpty);

var sources = coverage.fold({}, (Map map, value) {
var sources = coverage.fold<Map<String, dynamic>>(<String, dynamic>{},
(Map<String, dynamic> map, dynamic value) {
String sourceUri = value['source'];
map.putIfAbsent(sourceUri, () => <Map>[]).add(value);
return map;
Expand Down

0 comments on commit ca241a7

Please sign in to comment.