Skip to content

Commit e178935

Browse files
authored
Avoid importing all of test_core from load_suite (#1337)
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`.
1 parent 2549de3 commit e178935

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pkgs/test_core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 0.3.12-nullsafety.5-dev
2+
13
## 0.3.12-nullsafety.4
24

35
* Support latest `package:vm_service`.

pkgs/test_core/lib/src/runner/load_suite.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ import 'package:test_api/src/backend/suite.dart'; // ignore: implementation_impo
1414
import 'package:test_api/src/backend/suite_platform.dart'; // ignore: implementation_imports
1515
import 'package:test_api/src/backend/test.dart'; // ignore: implementation_imports
1616
import 'package:test_api/src/utils.dart'; // ignore: implementation_imports
17+
// ignore: deprecated_member_use
18+
import 'package:test_api/test_api.dart' show Timeout;
1719

18-
import '../../test_core.dart';
19-
import '../util/io_stub.dart'
20-
// ignore: uri_does_not_exist
21-
if (dart.library.io) '../util/io.dart';
20+
import '../util/io_stub.dart' if (dart.library.io) '../util/io.dart';
2221
import 'load_exception.dart';
2322
import 'plugin/environment.dart';
2423
import 'runner_suite.dart';
@@ -76,7 +75,7 @@ class LoadSuite extends Suite implements RunnerSuite {
7675
///
7776
/// Load suites are guaranteed to only contain one test. This is a utility
7877
/// method for accessing it directly.
79-
Test get test => this.group.entries.single as Test;
78+
Test get test => group.entries.single as Test;
8079

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

200199
@override
201200
LoadSuite filter(bool Function(Test) callback) {
202-
var filtered = this.group.filter(callback);
201+
var filtered = group.filter(callback);
203202
filtered ??= Group.root([], metadata: metadata);
204203
return LoadSuite._filtered(this, filtered);
205204
}

pkgs/test_core/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: test_core
2-
version: 0.3.12-nullsafety.4
2+
version: 0.3.12-nullsafety.5-dev
33
description: A basic library for writing tests and running them on the VM.
44
homepage: https://github.com/dart-lang/test/blob/master/pkgs/test_core
55

0 commit comments

Comments
 (0)