Skip to content

Commit a02d5bb

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/language/f-l using the 3.8 style.
Change-Id: I7dafd578cf8da38616ae25e5ce8dbbc7e3213014 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425185 Reviewed-by: Lasse Nielsen <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]>
1 parent 159de51 commit a02d5bb

File tree

41 files changed

+339
-452
lines changed

Some content is hidden

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

41 files changed

+339
-452
lines changed

tests/language/function/literals_test.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,18 @@ class FunctionLiteralsTest {
4949
}
5050

5151
void testArrowArrow() {
52-
checkIntFuncFunction(84, (x) => (y) => (x as int) + (y as int), 42);
53-
checkIntFuncFunction(84, (dynamic x) => (y) => x + y, 42);
52+
checkIntFuncFunction(
53+
84,
54+
(x) =>
55+
(y) => (x as int) + (y as int),
56+
42,
57+
);
58+
checkIntFuncFunction(
59+
84,
60+
(dynamic x) =>
61+
(y) => x + y,
62+
42,
63+
);
5464
}
5565

5666
void testArrowBlock() {

tests/language/function_type/test_generator.dart

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -439,47 +439,41 @@ List<FunctionType> buildFunctionTypes() {
439439
// new NominalType("List", "", [new NominalType("Function")]),
440440
];
441441

442-
List<TypeLike?> basicsPlusNull =
443-
[
444-
basicTypes,
445-
<TypeLike?>[null],
446-
].expand((x) => x).toList();
447-
448-
List<TypeLike?> basicsPlusNullPlusVoid =
449-
[
450-
basicsPlusNull,
451-
[NominalType("void")],
452-
].expand((x) => x).toList();
453-
454-
List<TypeLike?> basicsPlusNullPlusB =
455-
[
456-
basicsPlusNull,
457-
[
458-
NominalType("B"),
459-
NominalType("List", "", [NominalType("B")]),
460-
],
461-
].expand((x) => x).toList();
462-
463-
List<TypeLike?> basicsPlusNullPlusBPlusVoid =
464-
[
465-
basicsPlusNullPlusB,
466-
[NominalType("void")],
467-
].expand((x) => x).toList();
468-
469-
List<TypeLike?> basicsPlusNullPlusA =
470-
[
471-
basicsPlusNull,
472-
[
473-
NominalType("A"),
474-
NominalType("List", "", [NominalType("A")]),
475-
],
476-
].expand((x) => x).toList();
477-
478-
List<TypeLike?> basicsPlusNullPlusAPlusVoid =
479-
[
480-
basicsPlusNullPlusA,
481-
[NominalType("void")],
482-
].expand((x) => x).toList();
442+
List<TypeLike?> basicsPlusNull = [
443+
basicTypes,
444+
<TypeLike?>[null],
445+
].expand((x) => x).toList();
446+
447+
List<TypeLike?> basicsPlusNullPlusVoid = [
448+
basicsPlusNull,
449+
[NominalType("void")],
450+
].expand((x) => x).toList();
451+
452+
List<TypeLike?> basicsPlusNullPlusB = [
453+
basicsPlusNull,
454+
[
455+
NominalType("B"),
456+
NominalType("List", "", [NominalType("B")]),
457+
],
458+
].expand((x) => x).toList();
459+
460+
List<TypeLike?> basicsPlusNullPlusBPlusVoid = [
461+
basicsPlusNullPlusB,
462+
[NominalType("void")],
463+
].expand((x) => x).toList();
464+
465+
List<TypeLike?> basicsPlusNullPlusA = [
466+
basicsPlusNull,
467+
[
468+
NominalType("A"),
469+
NominalType("List", "", [NominalType("A")]),
470+
],
471+
].expand((x) => x).toList();
472+
473+
List<TypeLike?> basicsPlusNullPlusAPlusVoid = [
474+
basicsPlusNullPlusA,
475+
[NominalType("void")],
476+
].expand((x) => x).toList();
483477

484478
List<FunctionType> buildFunctionTypes(
485479
TypeLike? returnType,

tests/language/generic/functions_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ class BinaryTreeNode<K extends Comparable<K>, V> {
2727
BinaryTreeNode<K, V> insert(K key, V value) {
2828
int c = key.compareTo(_key);
2929
if (c == 0) return this;
30-
var _insert =
31-
(BinaryTreeNode<K, V>? t, K key, V value) =>
32-
insertOpt<K, V>(t, key, value);
30+
var _insert = (BinaryTreeNode<K, V>? t, K key, V value) =>
31+
insertOpt<K, V>(t, key, value);
3332
BinaryTreeNode<K, V>? left = _left;
3433
BinaryTreeNode<K, V>? right = _right;
3534
if (c < 0) {
@@ -51,9 +50,8 @@ class BinaryTreeNode<K extends Comparable<K>, V> {
5150
}
5251

5352
S foldPre<S>(S init, S f(V t, S s)) {
54-
var _fold =
55-
(BinaryTreeNode<K, V>? t, S s, S f(V t, S s)) =>
56-
foldPreOpt<K, V, S>(t, s, f);
53+
var _fold = (BinaryTreeNode<K, V>? t, S s, S f(V t, S s)) =>
54+
foldPreOpt<K, V, S>(t, s, f);
5755
S s = init;
5856
s = f(_value, s);
5957
s = _fold(_left, s, f);

tests/language/generic/type_argument_substitution_test.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@ class B extends A<K> {}
1616
class X<T> {}
1717

1818
main() {
19-
var v =
20-
new DateTime.now().millisecondsSinceEpoch != 42
21-
? new X<B>()
22-
: new X<A<String>>();
19+
var v = new DateTime.now().millisecondsSinceEpoch != 42
20+
? new X<B>()
21+
: new X<A<String>>();
2322
Expect.isFalse(v is X<A<String>>);
2423
}

tests/language/generic_methods/generic_methods_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ class BinaryTreeNode<K extends Comparable<K>, V> {
3636
BinaryTreeNode<K, V> insert(K key, V value) {
3737
int c = key.compareTo(_key);
3838
if (c == 0) return this;
39-
var _insert =
40-
(BinaryTreeNode<K, V>? node, K key, V value) =>
41-
insertOpt<K, V>(node, key, value);
39+
var _insert = (BinaryTreeNode<K, V>? node, K key, V value) =>
40+
insertOpt<K, V>(node, key, value);
4241
BinaryTreeNode<K, V>? left = _left;
4342
BinaryTreeNode<K, V>? right = _right;
4443
if (c < 0) {
@@ -77,9 +76,8 @@ class BinaryTreeNode<K extends Comparable<K>, V> {
7776
}
7877

7978
S foldPre<S>(S init, S f(V t, S s)) {
80-
var _fold =
81-
(BinaryTreeNode<K, V>? t, S s, S f(V t, S s)) =>
82-
foldPreOpt<K, V, S>(t, s, f);
79+
var _fold = (BinaryTreeNode<K, V>? t, S s, S f(V t, S s)) =>
80+
foldPreOpt<K, V, S>(t, s, f);
8381
S s = init;
8482
s = f(_value, s);
8583
s = _fold(_left, s, f);

tests/language/implicit_creation/implicit_const_context_list_test.dart

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,15 @@ main() {
2424
const c1 = <int>[42];
2525

2626
// Inside const expression.
27-
var c2 =
28-
(const [
29-
<int>[42],
30-
])[0]; // List element.
31-
var c3 =
32-
(const {
33-
<int>[42]: 0,
34-
}).keys.first; // Map key.
35-
var c4 =
36-
(const {
37-
0: <int>[42],
38-
}).values.first; // Map value.
27+
var c2 = (const [
28+
<int>[42],
29+
])[0]; // List element.
30+
var c3 = (const {
31+
<int>[42]: 0,
32+
}).keys.first; // Map key.
33+
var c4 = (const {
34+
0: <int>[42],
35+
}).values.first; // Map value.
3936
var c5 = (const C(<int>[42])).x; // Constructor argument.
4037

4138
Expect.identical(c0, c1);

tests/language/implicit_creation/implicit_const_context_map_test.dart

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,15 @@ main() {
2424
const c1 = <int, int>{37: 87};
2525

2626
// Inside const expression.
27-
var c2 =
28-
(const [
29-
<int, int>{37: 87},
30-
])[0]; // List element.
31-
var c3 =
32-
(const {
33-
<int, int>{37: 87}: 0,
34-
}).keys.first; // Map key.
35-
var c4 =
36-
(const {
37-
0: <int, int>{37: 87},
38-
}).values.first; // Map value.
27+
var c2 = (const [
28+
<int, int>{37: 87},
29+
])[0]; // List element.
30+
var c3 = (const {
31+
<int, int>{37: 87}: 0,
32+
}).keys.first; // Map key.
33+
var c4 = (const {
34+
0: <int, int>{37: 87},
35+
}).values.first; // Map value.
3936
var c5 = (const C(<int, int>{37: 87})).x; // Constructor argument.
4037

4138
Expect.identical(c0, c1);

tests/language/inference_update_1/horizontal_inference_invocation_types_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@ import 'package:expect/static_type_helper.dart';
88

99
testFunctionExpressionInvocation() {
1010
(<T>(T t, void Function(T) f) => t)(0, (x) {
11-
x.expectStaticType<Exactly<int>>();
12-
})
13-
.expectStaticType<Exactly<int>>();
11+
x.expectStaticType<Exactly<int>>();
12+
}).expectStaticType<Exactly<int>>();
1413
}
1514

1615
testInstanceCreation() {

tests/language/inference_update_2/promotion_narrows_interface_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ class A {
1717
}
1818

1919
class B extends A {
20-
int Function(num) get getter => (_) => 0;
20+
int Function(num) get getter =>
21+
(_) => 0;
2122
int method(num value) => 0;
2223
int call(num value) => 0;
2324
int operator [](num index) => 0;

tests/language/inference_update_2/top_level_type_inference_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,17 @@ class C {
2929

3030
late final instancePromotableViaThis = _promotable != null ? _promotable : 0;
3131

32-
late final instanceNotPromotableViaThis =
33-
_notPromotable != null ? _notPromotable : 0;
32+
late final instanceNotPromotableViaThis = _notPromotable != null
33+
? _notPromotable
34+
: 0;
3435
}
3536

3637
class D {
3738
int? _notPromotable;
3839
}
3940

40-
final topLevelPromotable = ((C c) => c._promotable != null ? c._promotable : 0)(
41-
new C(0),
42-
);
41+
final topLevelPromotable = ((C c) =>
42+
c._promotable != null ? c._promotable : 0)(new C(0));
4343

4444
final topLevelNotPromotable = ((C c) =>
4545
c._notPromotable != null ? c._notPromotable : 0)(new C(0));

0 commit comments

Comments
 (0)