Reformat with latest dev SDK (#2641)
diff --git a/pkgs/test/test/runner/browser/expanded_reporter_test.dart b/pkgs/test/test/runner/browser/expanded_reporter_test.dart
index 7c9a4d0..464b67b 100644
--- a/pkgs/test/test/runner/browser/expanded_reporter_test.dart
+++ b/pkgs/test/test/runner/browser/expanded_reporter_test.dart
@@ -13,10 +13,8 @@
void main() {
setUpAll(precompileTestExecutable);
- test(
- 'prints the platform name when running on multiple platforms',
- () async {
- await d.file('test.dart', '''
+ test('prints the platform name when running on multiple platforms', () async {
+ await d.file('test.dart', '''
import 'dart:async';
import 'package:test/test.dart';
@@ -26,15 +24,13 @@
}
''').create();
- var test = await runTest([
- '-r', 'expanded', '-p', 'chrome', '-p', 'vm', '-j', '1', //
- 'test.dart',
- ]);
+ var test = await runTest([
+ '-r', 'expanded', '-p', 'chrome', '-p', 'vm', '-j', '1', //
+ 'test.dart',
+ ]);
- expect(test.stdoutStream(), emitsThrough(contains('[VM, Kernel]')));
- expect(test.stdout, emitsThrough(contains('[Chrome, Dart2Js]')));
- await test.shouldExit(0);
- },
- tags: ['chrome'],
- );
+ expect(test.stdoutStream(), emitsThrough(contains('[VM, Kernel]')));
+ expect(test.stdout, emitsThrough(contains('[Chrome, Dart2Js]')));
+ await test.shouldExit(0);
+ }, tags: ['chrome']);
}
diff --git a/pkgs/test/test/runner/configuration/platform_test.dart b/pkgs/test/test/runner/configuration/platform_test.dart
index 9158a87..1878d82 100644
--- a/pkgs/test/test/runner/configuration/platform_test.dart
+++ b/pkgs/test/test/runner/configuration/platform_test.dart
@@ -18,21 +18,19 @@
setUpAll(precompileTestExecutable);
group('on_platform', () {
- test(
- 'applies platform-specific configuration to matching tests',
- () async {
- await d
- .file(
- 'dart_test.yaml',
- jsonEncode({
- 'on_platform': {
- 'chrome': {'timeout': '0s'},
- },
- }),
- )
- .create();
+ test('applies platform-specific configuration to matching tests', () async {
+ await d
+ .file(
+ 'dart_test.yaml',
+ jsonEncode({
+ 'on_platform': {
+ 'chrome': {'timeout': '0s'},
+ },
+ }),
+ )
+ .create();
- await d.file('test.dart', '''
+ await d.file('test.dart', '''
import 'dart:async';
import 'package:test/test.dart';
@@ -42,18 +40,16 @@
}
''').create();
- var test = await runTest(['-p', 'chrome,vm', 'test.dart']);
- expect(
- test.stdout,
- containsInOrder([
- '-1: [Chrome, Dart2Js] test [E]',
- '+1 -1: Some tests failed.',
- ]),
- );
- await test.shouldExit(1);
- },
- tags: ['chrome'],
- );
+ var test = await runTest(['-p', 'chrome,vm', 'test.dart']);
+ expect(
+ test.stdout,
+ containsInOrder([
+ '-1: [Chrome, Dart2Js] test [E]',
+ '+1 -1: Some tests failed.',
+ ]),
+ );
+ await test.shouldExit(1);
+ }, tags: ['chrome']);
test('supports platform selectors', () async {
await d
diff --git a/pkgs/test/test/runner/node/runner_test.dart b/pkgs/test/test/runner/node/runner_test.dart
index ec0a288..33e1f4c 100644
--- a/pkgs/test/test/runner/node/runner_test.dart
+++ b/pkgs/test/test/runner/node/runner_test.dart
@@ -106,41 +106,33 @@
await test.shouldExit(1);
});
- test(
- "a test file doesn't have a main defined",
- () async {
- await d.file('test.dart', 'void foo() {}').create();
+ test("a test file doesn't have a main defined", () async {
+ await d.file('test.dart', 'void foo() {}').create();
- var test = await runTest(['-p', 'node', 'test.dart']);
- expect(
- test.stdout,
- containsInOrder([
- '-1: loading test.dart [E]',
- 'Failed to load "test.dart": No top-level main() function defined.',
- ]),
- );
- await test.shouldExit(1);
- },
- skip: 'https://github.com/dart-lang/test/issues/894',
- );
+ var test = await runTest(['-p', 'node', 'test.dart']);
+ expect(
+ test.stdout,
+ containsInOrder([
+ '-1: loading test.dart [E]',
+ 'Failed to load "test.dart": No top-level main() function defined.',
+ ]),
+ );
+ await test.shouldExit(1);
+ }, skip: 'https://github.com/dart-lang/test/issues/894');
- test(
- 'a test file has a non-function main',
- () async {
- await d.file('test.dart', 'int main;').create();
+ test('a test file has a non-function main', () async {
+ await d.file('test.dart', 'int main;').create();
- var test = await runTest(['-p', 'node', 'test.dart']);
- expect(
- test.stdout,
- containsInOrder([
- '-1: loading test.dart [E]',
- 'Failed to load "test.dart": Top-level main getter is not a function.',
- ]),
- );
- await test.shouldExit(1);
- },
- skip: 'https://github.com/dart-lang/test/issues/894',
- );
+ var test = await runTest(['-p', 'node', 'test.dart']);
+ expect(
+ test.stdout,
+ containsInOrder([
+ '-1: loading test.dart [E]',
+ 'Failed to load "test.dart": Top-level main getter is not a function.',
+ ]),
+ );
+ await test.shouldExit(1);
+ }, skip: 'https://github.com/dart-lang/test/issues/894');
test('a test file has a main with arguments', () async {
await d.file('test.dart', 'void main(arg) {}').create();
@@ -233,10 +225,8 @@
await test.shouldExit(1);
});
- test(
- 'runs failing tests that fail only on node (with dart2wasm)',
- () async {
- await d.file('test.dart', '''
+ test('runs failing tests that fail only on node (with dart2wasm)', () async {
+ await d.file('test.dart', '''
import 'package:path/path.dart' as p;
import 'package:test/test.dart';
@@ -249,31 +239,27 @@
}
''').create();
- var test = await runTest([
- '-p',
- 'node',
- '-p',
- 'vm',
- '-c',
- 'dart2js',
- '-c',
- 'dart2wasm',
- 'test.dart',
- ]);
- expect(test.stdout, emitsThrough(contains('+1 -2: Some tests failed.')));
- await test.shouldExit(1);
- },
- skip: skipBelowMajorNodeVersion(22),
- );
+ var test = await runTest([
+ '-p',
+ 'node',
+ '-p',
+ 'vm',
+ '-c',
+ 'dart2js',
+ '-c',
+ 'dart2wasm',
+ 'test.dart',
+ ]);
+ expect(test.stdout, emitsThrough(contains('+1 -2: Some tests failed.')));
+ await test.shouldExit(1);
+ }, skip: skipBelowMajorNodeVersion(22));
- test(
- 'gracefully handles wasm errors on old node versions',
- () async {
- // Old Node.JS versions can't read the WebAssembly modules emitted by
- // dart2wasm. The node process exits before connecting to the server
- // opened by the test runner, leading to timeouts. So, this is a
- // regression test for https://github.com/dart-lang/test/pull/2259#issuecomment-2307868442
- await d.file('test.dart', '''
+ test('gracefully handles wasm errors on old node versions', () async {
+ // Old Node.JS versions can't read the WebAssembly modules emitted by
+ // dart2wasm. The node process exits before connecting to the server
+ // opened by the test runner, leading to timeouts. So, this is a
+ // regression test for https://github.com/dart-lang/test/pull/2259#issuecomment-2307868442
+ await d.file('test.dart', '''
import 'package:test/test.dart';
void main() {
@@ -283,20 +269,18 @@
}
''').create();
- var test = await runTest(['-p', 'node', '-c', 'dart2wasm', 'test.dart']);
- expect(
- test.stdout,
- emitsInOrder([
- emitsThrough(
- contains('Node exited before connecting to the test channel.'),
- ),
- emitsThrough(contains('-1: Some tests failed.')),
- ]),
- );
- await test.shouldExit(1);
- },
- skip: skipAboveMajorNodeVersion(21),
- );
+ var test = await runTest(['-p', 'node', '-c', 'dart2wasm', 'test.dart']);
+ expect(
+ test.stdout,
+ emitsInOrder([
+ emitsThrough(
+ contains('Node exited before connecting to the test channel.'),
+ ),
+ emitsThrough(contains('-1: Some tests failed.')),
+ ]),
+ );
+ await test.shouldExit(1);
+ }, skip: skipAboveMajorNodeVersion(21));
test('forwards prints from the Node test', () async {
await d.file('test.dart', '''
diff --git a/pkgs/test/test/runner/runner_test.dart b/pkgs/test/test/runner/runner_test.dart
index 7198fdf..8a8594f 100644
--- a/pkgs/test/test/runner/runner_test.dart
+++ b/pkgs/test/test/runner/runner_test.dart
@@ -842,27 +842,23 @@
});
for (var platform in ['vm', 'chrome']) {
- test(
- 'on the $platform platform',
- () async {
- var test = await runTest(
- ['test.dart', '-p', platform],
- vmArgs: ['--enable-experiment=non-nullable'],
- );
+ test('on the $platform platform', () async {
+ var test = await runTest(
+ ['test.dart', '-p', platform],
+ vmArgs: ['--enable-experiment=non-nullable'],
+ );
- await expectLater(test.stdout, emitsThrough(contains('int x;')));
- await test.shouldExit(1);
+ await expectLater(test.stdout, emitsThrough(contains('int x;')));
+ await test.shouldExit(1);
- // Test that they can be removed on subsequent runs as well
- test = await runTest(['test.dart', '-p', platform]);
- await expectLater(
- test.stdout,
- emitsThrough(contains('+1: All tests passed!')),
- );
- await test.shouldExit(0);
- },
- skip: 'https://github.com/dart-lang/test/issues/1813',
- );
+ // Test that they can be removed on subsequent runs as well
+ test = await runTest(['test.dart', '-p', platform]);
+ await expectLater(
+ test.stdout,
+ emitsThrough(contains('+1: All tests passed!')),
+ );
+ await test.shouldExit(0);
+ }, skip: 'https://github.com/dart-lang/test/issues/1813');
}
});
});
@@ -900,22 +896,18 @@
await test.shouldExit(0);
});
- test(
- 'on the browser platform',
- () async {
- var test = await runTest([
- '-p',
- 'vm,chrome',
- 'a_test.dart',
- 'b_test.dart',
- ]);
- await expectLater(
- test.stdout,
- emitsThrough(contains('+3: All tests passed!')),
- );
- await test.shouldExit(0);
- },
- skip: 'https://github.com/dart-lang/test/issues/1803',
- );
+ test('on the browser platform', () async {
+ var test = await runTest([
+ '-p',
+ 'vm,chrome',
+ 'a_test.dart',
+ 'b_test.dart',
+ ]);
+ await expectLater(
+ test.stdout,
+ emitsThrough(contains('+3: All tests passed!')),
+ );
+ await test.shouldExit(0);
+ }, skip: 'https://github.com/dart-lang/test/issues/1803');
});
}
diff --git a/pkgs/test_api/test/import_restrictions_test.dart b/pkgs/test_api/test/import_restrictions_test.dart
index 421c065..9256d4c 100644
--- a/pkgs/test_api/test/import_restrictions_test.dart
+++ b/pkgs/test_api/test/import_restrictions_test.dart
@@ -36,11 +36,10 @@
entryPoints,
)) {
for (final import in source.imports) {
- expect(
- import.pathSegments.skip(1).take(2),
- ['src', 'backend'],
- reason: 'Invalid import from ${source.uri} : $import',
- );
+ expect(import.pathSegments.skip(1).take(2), [
+ 'src',
+ 'backend',
+ ], reason: 'Invalid import from ${source.uri} : $import');
}
}
});