Skip to content

Commit 8a51cb6

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/lib/isolate/** using 3.8 style.
Change-Id: I8fafc8c2788faf848a8a8488b76cb163b7679308 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425330 Commit-Queue: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]>
1 parent bf13a57 commit 8a51cb6

File tree

56 files changed

+635
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+635
-424
lines changed

tests/lib/isolate/deeply_immutable_no_ffi_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import 'dart:isolate';
1313
final class Foo {
1414
dynamic myMutableField;
1515
// ^
16-
// [cfe] Deeply immutable classes must only have final non-late instance fields.
1716
// [cfe] Deeply immutable classes must only have deeply immutable instance fields. Deeply immutable types include 'int', 'double', 'bool', 'String', 'Pointer', 'Float32x4', 'Float64x2', 'Int32x4', and classes annotated with `@pragma('vm:deeply-immutable')`.
17+
// [cfe] Deeply immutable classes must only have final non-late instance fields.
1818
}
1919

2020
Future<T> sendReceive<T>(T o) async {

tests/lib/isolate/deeply_immutable_test.dart

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -129,56 +129,36 @@ final class Class7 {
129129
}
130130

131131
void testInstantiateImmutableHierarchy() {
132-
Class8(
133-
animal: Cat(
134-
numberOfLegs: 4,
135-
averageNumberOfMeowsPerDay: 42.0,
136-
),
137-
);
138-
Class8(
139-
animal: Dog(
140-
numberOfLegs: 4,
141-
averageNumberOfWoofsPerDay: 1337.0,
142-
),
143-
);
132+
Class8(animal: Cat(numberOfLegs: 4, averageNumberOfMeowsPerDay: 42.0));
133+
Class8(animal: Dog(numberOfLegs: 4, averageNumberOfWoofsPerDay: 1337.0));
144134
}
145135

146136
@pragma('vm:deeply-immutable')
147137
final class Animal {
148138
final int numberOfLegs;
149139

150-
Animal({
151-
required this.numberOfLegs,
152-
});
140+
Animal({required this.numberOfLegs});
153141
}
154142

155143
@pragma('vm:deeply-immutable')
156144
final class Cat extends Animal {
157145
final double averageNumberOfMeowsPerDay;
158146

159-
Cat({
160-
required super.numberOfLegs,
161-
required this.averageNumberOfMeowsPerDay,
162-
});
147+
Cat({required super.numberOfLegs, required this.averageNumberOfMeowsPerDay});
163148
}
164149

165150
@pragma('vm:deeply-immutable')
166151
final class Dog extends Animal {
167152
final double averageNumberOfWoofsPerDay;
168153

169-
Dog({
170-
required super.numberOfLegs,
171-
required this.averageNumberOfWoofsPerDay,
172-
});
154+
Dog({required super.numberOfLegs, required this.averageNumberOfWoofsPerDay});
173155
}
174156

175157
@pragma('vm:deeply-immutable')
176158
final class Class8 {
177159
final Animal animal;
178160

179-
Class8({
180-
required this.animal,
181-
});
161+
Class8({required this.animal});
182162
}
183163

184164
@pragma('vm:deeply-immutable')
@@ -195,16 +175,16 @@ sealed class Class11 {}
195175

196176
@pragma('vm:deeply-immutable')
197177
class NotSealedOrFinalClass {}
198-
// ^^^^^^^^^^^^^^^^^^^^^
178+
// ^
199179
// [cfe] Deeply immutable classes must be final or sealed.
200180

201181
final class Class12 extends DeeplyImmutableInterface {}
202-
// ^^^^^^^
182+
// ^
203183
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
204184

205185
final class Class13 implements DeeplyImmutableInterface {
206-
// ^^^^^^^
207-
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
186+
// ^
187+
// [cfe] Subtypes of deeply immutable classes must be deeply immutable.
208188
}
209189

210190
@pragma('vm:deeply-immutable')
@@ -217,13 +197,14 @@ final class Class14<T extends DeeplyImmutableInterface> {
217197
@pragma('vm:deeply-immutable')
218198
final class Class15<T extends NotDeeplyImmutable> {
219199
final T notDeeplyImmutable;
220-
// ^^^^^^^^^^^^^^^^^^
200+
// ^
221201
// [cfe] Deeply immutable classes must only have deeply immutable instance fields. Deeply immutable types include 'int', 'double', 'bool', 'String', 'Pointer', 'Float32x4', 'Float64x2', 'Int32x4', and classes annotated with `@pragma('vm:deeply-immutable')`.
222202

223203
Class15({required this.notDeeplyImmutable});
224204
}
225205

226206
@pragma('vm:deeply-immutable')
227207
abstract mixin class Class17 {}
228-
// ^^^^^^^
208+
// ^
229209
// [cfe] Deeply immutable classes must be final or sealed.
210+

tests/lib/isolate/error_at_spawn_test.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ main() {
2626
asyncEnd();
2727
};
2828

29-
Isolate.spawn(isomain, null,
30-
// Setup handler as part of spawn.
31-
errorsAreFatal: false,
32-
onError: errorPort.sendPort);
29+
Isolate.spawn(
30+
isomain,
31+
null,
32+
// Setup handler as part of spawn.
33+
errorsAreFatal: false,
34+
onError: errorPort.sendPort,
35+
);
3336
}

tests/lib/isolate/error_at_spawnuri_test.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,12 @@ main() {
2121
asyncEnd();
2222
};
2323

24-
Isolate.spawnUri(Uri.parse("error_at_spawnuri_iso.dart"), [], null,
25-
// Setup handler as part of spawn.
26-
errorsAreFatal: false,
27-
onError: errorPort.sendPort);
24+
Isolate.spawnUri(
25+
Uri.parse("error_at_spawnuri_iso.dart"),
26+
[],
27+
null,
28+
// Setup handler as part of spawn.
29+
errorsAreFatal: false,
30+
onError: errorPort.sendPort,
31+
);
2832
}

tests/lib/isolate/error_exit_at_spawn_test.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ import 'error_exit_at_spawning_shared.dart';
1010

1111
main() {
1212
testIsolate((SendPort replyPort, SendPort errorPort, SendPort exitPort) {
13-
Isolate.spawn(isomain, replyPort,
14-
// Setup handlers as part of spawn.
15-
errorsAreFatal: false,
16-
onError: errorPort,
17-
onExit: exitPort);
13+
Isolate.spawn(
14+
isomain,
15+
replyPort,
16+
// Setup handlers as part of spawn.
17+
errorsAreFatal: false,
18+
onError: errorPort,
19+
onExit: exitPort,
20+
);
1821
});
1922
}

tests/lib/isolate/error_exit_at_spawning_shared.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ isomain(replyPort) {
3232
}
3333

3434
testIsolate(
35-
void spawnIsolate(SendPort reply, SendPort errorPort, SendPort exitPort)) {
35+
void spawnIsolate(SendPort reply, SendPort errorPort, SendPort exitPort),
36+
) {
3637
asyncStart();
3738
// Setup the port for communication with the newly spawned isolate.
3839
RawReceivePort reply = new RawReceivePort(null);

tests/lib/isolate/error_exit_at_spawnuri_test.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,13 @@ import 'error_exit_at_spawning_shared.dart';
1111
main() {
1212
testIsolate((SendPort replyPort, SendPort errorPort, SendPort exitPort) {
1313
Isolate.spawnUri(
14-
Uri.parse("error_exit_at_spawning_shared.dart"), [], replyPort,
15-
// Setup handlers as part of spawn.
16-
errorsAreFatal: false,
17-
onError: errorPort,
18-
onExit: exitPort);
14+
Uri.parse("error_exit_at_spawning_shared.dart"),
15+
[],
16+
replyPort,
17+
// Setup handlers as part of spawn.
18+
errorsAreFatal: false,
19+
onError: errorPort,
20+
onExit: exitPort,
21+
);
1922
});
2023
}

tests/lib/isolate/exit_at_spawn_test.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,11 @@ void test(mainFunction) {
4343
};
4444

4545
// Ignore returned Future.
46-
Isolate.spawn(mainFunction, null,
47-
// Setup handler as part of spawn.
48-
errorsAreFatal: false,
49-
onExit: exitPort.sendPort);
46+
Isolate.spawn(
47+
mainFunction,
48+
null,
49+
// Setup handler as part of spawn.
50+
errorsAreFatal: false,
51+
onExit: exitPort.sendPort,
52+
);
5053
}

tests/lib/isolate/exit_at_spawnuri_test.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ main() {
1919
};
2020

2121
// Ignore returned Future.
22-
Isolate.spawnUri(Uri.parse("exit_at_spawnuri_iso.dart"), [], null,
23-
// Setup handler as part of spawn.
24-
errorsAreFatal: false,
25-
onExit: exitPort.sendPort);
22+
Isolate.spawnUri(
23+
Uri.parse("exit_at_spawnuri_iso.dart"),
24+
[],
25+
null,
26+
// Setup handler as part of spawn.
27+
errorsAreFatal: false,
28+
onExit: exitPort.sendPort,
29+
);
2630
}

tests/lib/isolate/function_send1_test.dart

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@ void toplevel(port, message) {
1212
}
1313

1414
Function createFuncToplevel() => (p, m) {
15-
p.send(m);
16-
};
15+
p.send(m);
16+
};
1717

1818
class C {
1919
Function initializer;
2020
Function body;
2121
C()
22-
: initializer = ((p, m) {
23-
throw "initializer";
24-
}),
25-
body = ((p, m) {
26-
throw "body";
27-
}) {}
22+
: initializer = ((p, m) {
23+
throw "initializer";
24+
}),
25+
body = ((p, m) {
26+
throw "body";
27+
}) {}
2828
static void staticFunc(port, message) {
2929
port.send("static:$message");
3030
}
3131

3232
static Function createFuncStatic() => (p, m) {
33-
throw "static expr";
34-
};
33+
throw "static expr";
34+
};
3535
void instanceMethod(p, m) {
3636
throw "instanceMethod";
3737
}
3838

3939
Function createFuncMember() => (p, m) {
40-
throw "instance expr";
41-
};
40+
throw "instance expr";
41+
};
4242
void call(n, p) {
4343
throw "C";
4444
}
@@ -103,8 +103,10 @@ Future<SendPort> echoPort(callback(value)) {
103103
completer.complete(p);
104104
initPort.close();
105105
});
106-
return Isolate.spawn(_echo, [replyPort, initPort.sendPort])
107-
.then((isolate) => completer.future);
106+
return Isolate.spawn(_echo, [
107+
replyPort,
108+
initPort.sendPort,
109+
]).then((isolate) => completer.future);
108110
}
109111

110112
void _echo(msg) {
@@ -131,15 +133,19 @@ void _call(initPort) {
131133

132134
void testUnsendable(name, func) {
133135
asyncStart();
134-
Isolate.spawnUri(Uri.parse("function_send_test.dart"), [], func)
135-
.then<void>((v) => throw "allowed spawn direct?", onError: (e, s) {
136-
asyncEnd();
137-
});
136+
Isolate.spawnUri(Uri.parse("function_send_test.dart"), [], func).then<void>(
137+
(v) => throw "allowed spawn direct?",
138+
onError: (e, s) {
139+
asyncEnd();
140+
},
141+
);
138142
asyncStart();
139-
Isolate.spawnUri(Uri.parse("function_send_test.dart"), [], [func])
140-
.then<void>((v) => throw "allowed spawn wrapped?", onError: (e, s) {
141-
asyncEnd();
142-
});
143+
Isolate.spawnUri(Uri.parse("function_send_test.dart"), [], [func]).then<void>(
144+
(v) => throw "allowed spawn wrapped?",
145+
onError: (e, s) {
146+
asyncEnd();
147+
},
148+
);
143149
}
144150

145151
void callFunc(message) {

0 commit comments

Comments
 (0)