Skip to content

Commit

Permalink
Avoid importing all of test_core from load_suite (#1337)
Browse files Browse the repository at this point in the history
This will make it easier to separate the package into more fine grained
targets.

Other minor cleanup:
- Remove a stale ignore from when DDC struggled with conditional
  imports.
- Fix some lints about unnecessary `this`.
  • Loading branch information
natebosch authored Sep 14, 2020
1 parent 2549de3 commit e178935
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 0.3.12-nullsafety.5-dev

## 0.3.12-nullsafety.4

* Support latest `package:vm_service`.
Expand Down
11 changes: 5 additions & 6 deletions pkgs/test_core/lib/src/runner/load_suite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ import 'package:test_api/src/backend/suite.dart'; // ignore: implementation_impo
import 'package:test_api/src/backend/suite_platform.dart'; // ignore: implementation_imports
import 'package:test_api/src/backend/test.dart'; // ignore: implementation_imports
import 'package:test_api/src/utils.dart'; // ignore: implementation_imports
// ignore: deprecated_member_use
import 'package:test_api/test_api.dart' show Timeout;

import '../../test_core.dart';
import '../util/io_stub.dart'
// ignore: uri_does_not_exist
if (dart.library.io) '../util/io.dart';
import '../util/io_stub.dart' if (dart.library.io) '../util/io.dart';
import 'load_exception.dart';
import 'plugin/environment.dart';
import 'runner_suite.dart';
Expand Down Expand Up @@ -76,7 +75,7 @@ class LoadSuite extends Suite implements RunnerSuite {
///
/// Load suites are guaranteed to only contain one test. This is a utility
/// method for accessing it directly.
Test get test => this.group.entries.single as Test;
Test get test => group.entries.single as Test;

/// Creates a load suite named [name] on [platform].
///
Expand Down Expand Up @@ -199,7 +198,7 @@ class LoadSuite extends Suite implements RunnerSuite {

@override
LoadSuite filter(bool Function(Test) callback) {
var filtered = this.group.filter(callback);
var filtered = group.filter(callback);
filtered ??= Group.root([], metadata: metadata);
return LoadSuite._filtered(this, filtered);
}
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_core
version: 0.3.12-nullsafety.4
version: 0.3.12-nullsafety.5-dev
description: A basic library for writing tests and running them on the VM.
homepage: https://github.com/dart-lang/test/blob/master/pkgs/test_core

Expand Down

0 comments on commit e178935

Please sign in to comment.