Skip to content

Commit d6ef495

Browse files
munificentCommit Queue
authored andcommitted
Format tests/lib/mirrors using 3.8 style.
Change-Id: I9f922f8a4106f993c63b55ebbe3c54ea999cbbd4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426287 Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]>
1 parent 36117c4 commit d6ef495

File tree

92 files changed

+1392
-821
lines changed

Some content is hidden

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

92 files changed

+1392
-821
lines changed

tests/lib/mirrors/abstract_test.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ abstract class Foo {}
1414

1515
void main() {
1616
expect(
17-
'Class(s(Foo) in s(test.abstract_test), top-level)', reflectClass(Foo));
17+
'Class(s(Foo) in s(test.abstract_test), top-level)',
18+
reflectClass(Foo),
19+
);
1820
}

tests/lib/mirrors/accessor_cache_overflow_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ main() {
3030
'C',
3131
'D',
3232
'E',
33-
'F'
33+
'F',
3434
];
3535
var symbols = <dynamic>[];
3636
for (var high in digits) {

tests/lib/mirrors/apply3_test.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ main() {
3030
var symbol = const Symbol('a');
3131
var requiredParameters = [1];
3232
var optionalParameters = new Map<Symbol, int>()..[symbol] = 42;
33-
Invocation i =
34-
Function.apply(new G(), requiredParameters, optionalParameters);
33+
Invocation i = Function.apply(
34+
new G(),
35+
requiredParameters,
36+
optionalParameters,
37+
);
3538

3639
Expect.equals(const Symbol('call'), i.memberName);
3740
Expect.listEquals(requiredParameters, i.positionalArguments);

tests/lib/mirrors/bad_argument_types_test.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,15 @@ void badClassStaticInvoke() {
7272
Map<String, String> map = Map<String, String>();
7373
map['bar'] = 'Hello world!';
7474
final cm = reflectClass(Foo);
75-
Expect.throwsTypeError(() => cm.invoke(#baz, [
76-
map
77-
], {
78-
#bar: {'boo': 'bah'}
79-
}));
75+
Expect.throwsTypeError(
76+
() => cm.invoke(
77+
#baz,
78+
[map],
79+
{
80+
#bar: {'boo': 'bah'},
81+
},
82+
),
83+
);
8084
}
8185

8286
void badStaticInvoke() {

tests/lib/mirrors/class_mirror_location_other.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
// "mixin", "mixin class" or the test should be left at 2.19.
77
// @dart=2.19
88

9+
// Don't let the formatter change the location of things.
10+
// dart format off
11+
912
part of test.class_location;
1013

1114
class ClassInOtherFile {}

tests/lib/mirrors/class_mirror_location_test.dart

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
// "mixin", "mixin class" or the test should be left at 2.19.
77
// @dart=2.19
88

9+
// Don't let the formatter change the location of things.
10+
// dart format off
11+
912
library test.class_location;
1013

1114
import "dart:mirrors";
@@ -52,21 +55,21 @@ main() {
5255
String otherSuffix = 'class_mirror_location_other.dart';
5356

5457
// This file.
55-
expectLocation(reflectClass(ClassInMainFile), mainSuffix, 12, 1);
56-
expectLocation(reflectClass(SpaceIndentedInMainFile), mainSuffix, 13, 3);
57-
expectLocation(reflectClass(TabIndentedInMainFile), mainSuffix, 14, 2);
58-
expectLocation(reflectClass(AbstractClass), mainSuffix, 16, 1);
59-
expectLocation(reflectType(Predicate), mainSuffix, 17, 1);
60-
expectLocation(reflectClass(MA), mainSuffix, 21, 1);
61-
expectLocation(reflectClass(MA2), mainSuffix, 22, 1);
62-
expectLocation(reflectClass(WithMetadata), mainSuffix, 26, 1);
63-
expectLocation(reflectClass(Enum), mainSuffix, 29, 1);
64-
expectLocation(reflectClass(AnnotatedEnum), mainSuffix, 31, 1);
58+
expectLocation(reflectClass(ClassInMainFile), mainSuffix, 19, 1);
59+
expectLocation(reflectClass(SpaceIndentedInMainFile), mainSuffix, 20, 3);
60+
expectLocation(reflectClass(TabIndentedInMainFile), mainSuffix, 21, 2);
61+
expectLocation(reflectClass(AbstractClass), mainSuffix, 23, 1);
62+
expectLocation(reflectType(Predicate), mainSuffix, 24, 1);
63+
expectLocation(reflectClass(MA), mainSuffix, 28, 1);
64+
expectLocation(reflectClass(MA2), mainSuffix, 29, 1);
65+
expectLocation(reflectClass(WithMetadata), mainSuffix, 34, 1);
66+
expectLocation(reflectClass(Enum), mainSuffix, 36, 1);
67+
expectLocation(reflectClass(AnnotatedEnum), mainSuffix, 39, 1);
6568

6669
// Another part.
67-
expectLocation(reflectClass(ClassInOtherFile), otherSuffix, 7, 1);
68-
expectLocation(reflectClass(SpaceIndentedInOtherFile), otherSuffix, 9, 3);
69-
expectLocation(reflectClass(TabIndentedInOtherFile), otherSuffix, 11, 2);
70+
expectLocation(reflectClass(ClassInOtherFile), otherSuffix, 14, 1);
71+
expectLocation(reflectClass(SpaceIndentedInOtherFile), otherSuffix, 16, 3);
72+
expectLocation(reflectClass(TabIndentedInOtherFile), otherSuffix, 18, 2);
7073

7174
// Synthetic classes.
7275
Expect.isNull(reflectClass(MA).superclass!.location);

tests/lib/mirrors/class_mirror_type_variables_expect.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ void testE(Env env) {
106106
Expect.isFalse(mapRAndHelperOfString.isOriginalDeclaration);
107107
Expect.equals(eR, mapRAndHelperOfString.typeArguments.first);
108108
Expect.equals(
109-
env.getHelperOfString(), mapRAndHelperOfString.typeArguments.last);
109+
env.getHelperOfString(),
110+
mapRAndHelperOfString.typeArguments.last,
111+
);
110112
}
111113

112114
void testF(Env env) {

tests/lib/mirrors/closurization_equivalence_test.dart

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,21 @@ class C {
1414

1515
main() {
1616
LibraryMirror thisLibrary = reflectClass(C).owner as LibraryMirror;
17-
Expect.equals(thisLibrary.declarations[#topLevelMethod],
18-
(reflect(topLevelMethod) as ClosureMirror).function, "topLevel");
17+
Expect.equals(
18+
thisLibrary.declarations[#topLevelMethod],
19+
(reflect(topLevelMethod) as ClosureMirror).function,
20+
"topLevel",
21+
);
1922

20-
Expect.equals(reflectClass(C).declarations[#staticMethod],
21-
(reflect(C.staticMethod) as ClosureMirror).function, "static");
23+
Expect.equals(
24+
reflectClass(C).declarations[#staticMethod],
25+
(reflect(C.staticMethod) as ClosureMirror).function,
26+
"static",
27+
);
2228

23-
Expect.equals(reflectClass(C).declarations[#instanceMethod],
24-
(reflect(new C().instanceMethod) as ClosureMirror).function, "instance");
29+
Expect.equals(
30+
reflectClass(C).declarations[#instanceMethod],
31+
(reflect(new C().instanceMethod) as ClosureMirror).function,
32+
"instance",
33+
);
2534
}

tests/lib/mirrors/constructor_optional_args_test.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,9 @@ class A {
1616
class B implements A {
1717
final _x, _y, _z;
1818

19-
B([x = 'x', y = 'y'])
20-
: _x = x,
21-
_y = y,
22-
_z = null;
23-
24-
B.more([x = 'x', y = 'y', z = 'z'])
25-
: _x = x,
26-
_y = y,
27-
_z = z;
19+
B([x = 'x', y = 'y']) : _x = x, _y = y, _z = null;
20+
21+
B.more([x = 'x', y = 'y', z = 'z']) : _x = x, _y = y, _z = z;
2822

2923
toString() => 'B(x=$_x, y=$_y, z=$_z)';
3024
}

tests/lib/mirrors/constructors_test.dart

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@ main() {
4545

4646
expect('{Foo: Method(s(Foo) in s(Foo), constructor)}', fooConstructors);
4747
expect('{Bar: Method(s(Bar) in s(Bar), constructor)}', barConstructors);
48-
expect('{Baz.named: Method(s(Baz.named) in s(Baz), constructor)}',
49-
bazConstructors);
5048
expect(
51-
'{Biz: Method(s(Biz) in s(Biz), constructor),'
52-
' Biz.named: Method(s(Biz.named) in s(Biz), constructor)}',
53-
bizConstructors);
49+
'{Baz.named: Method(s(Baz.named) in s(Baz), constructor)}',
50+
bazConstructors,
51+
);
52+
expect(
53+
'{Biz: Method(s(Biz) in s(Biz), constructor),'
54+
' Biz.named: Method(s(Biz.named) in s(Biz), constructor)}',
55+
bizConstructors,
56+
);
5457
print(bizConstructors);
5558

5659
expect('[]', fooConstructors.values.single.parameters);
@@ -61,13 +64,20 @@ main() {
6164
}
6265

6366
expect(
64-
'[s()]', fooConstructors.values.map((m) => m.constructorName).toList());
67+
'[s()]',
68+
fooConstructors.values.map((m) => m.constructorName).toList(),
69+
);
70+
expect(
71+
'[s()]',
72+
barConstructors.values.map((m) => m.constructorName).toList(),
73+
);
6574
expect(
66-
'[s()]', barConstructors.values.map((m) => m.constructorName).toList());
67-
expect('[s(named)]',
68-
bazConstructors.values.map((m) => m.constructorName).toList());
75+
'[s(named)]',
76+
bazConstructors.values.map((m) => m.constructorName).toList(),
77+
);
6978
expect(
70-
'[s(), s(named)]',
71-
bizConstructors.values.map((m) => m.constructorName).toList()
72-
..sort(compareSymbols));
79+
'[s(), s(named)]',
80+
bizConstructors.values.map((m) => m.constructorName).toList()
81+
..sort(compareSymbols),
82+
);
7383
}

0 commit comments

Comments
 (0)