Skip to content

Commit 0906af6

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/corelib/.
I also regenerated the static error expectations (see #57042 for context). Change-Id: Ia0ca22604a0dd422cc265a46845afc43f551fe38 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394572 Commit-Queue: Lasse Nielsen <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]>
1 parent be1b2a9 commit 0906af6

File tree

234 files changed

+10513
-6133
lines changed

Some content is hidden

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

234 files changed

+10513
-6133
lines changed

tests/corelib/apply2_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ apply(Function function, List? positional, Map<Symbol, dynamic>? named) {
1212
}
1313

1414
void throwsNSME(
15-
Function function, List? positional, Map<Symbol, dynamic>? named) {
15+
Function function,
16+
List? positional,
17+
Map<Symbol, dynamic>? named,
18+
) {
1619
Expect.throwsNoSuchMethodError(() => apply(function, positional, named));
1720
}
1821

tests/corelib/apply6_test.dart

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ class A {
1818
g = 70,
1919
h = 80,
2020
i = 90,
21-
]) =>
22-
'$a $b $c $d $e $f $g $h $i';
21+
]) => '$a $b $c $d $e $f $g $h $i';
2322
}
2423

2524
String static1(a, b, {c = 30, d = 40}) => '$a $b $c $d';
2625

27-
void test(String expected, Function function, List positional,
28-
[Map<Symbol, dynamic>? named = null]) {
26+
void test(
27+
String expected,
28+
Function function,
29+
List positional, [
30+
Map<Symbol, dynamic>? named = null,
31+
]) {
2932
final original = List.of(positional);
3033

3134
Expect.equals(expected, Function.apply(function, positional, named));
@@ -48,8 +51,9 @@ main() {
4851
test('11 22 33 44 55 66 70 80 90', a.foo, [11, 22, 33, 44, 55, 66]);
4952
test('11 22 33 44 55 66 77 80 90', a.foo, [11, 22, 33, 44, 55, 66, 77]);
5053
test('11 22 33 44 55 66 77 88 90', a.foo, [11, 22, 33, 44, 55, 66, 77, 88]);
51-
test('11 22 33 44 55 66 77 88 99', a.foo,
52-
[11, 22, 33, 44, 55, 66, 77, 88, 99]);
54+
test('11 22 33 44 55 66 77 88 99', a.foo, [
55+
11, 22, 33, 44, 55, 66, 77, 88, 99, //
56+
]);
5357

5458
// Some unmodifiable Lists. An attempt to modify the argument would fail.
5559
test('11 22 33 44 55 66 77 80 90', a.foo, const [11, 22, 33, 44, 55, 66, 77]);

tests/corelib/apply_test.dart

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,19 @@ main() {
6565

6666
// Test that apply can itself be applied.
6767
Expect.equals(
68-
42,
69-
Function.apply(Function.apply, [
70-
test2,
71-
[17, 25]
72-
]));
68+
42,
69+
Function.apply(Function.apply, [
70+
test2,
71+
[17, 25],
72+
]),
73+
);
7374

7475
// Test that apply works on callable objects when it is passed to a method
7576
// that expects Function (and not dynamic).
7677
Expect.throwsWhen(
77-
v.checkedImplicitDowncasts, () => testList(42, new Callable(), [13, 29]));
78+
v.checkedImplicitDowncasts,
79+
() => testList(42, new Callable(), [13, 29]),
80+
);
7881

7982
testListTyped(42, new Callable(), [13, 29]);
8083
}

tests/corelib/bigint_add_test.dart

Lines changed: 156 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -25,118 +25,166 @@ expectSum(aString, bString, expectedString) {
2525

2626
main() {
2727
expectSum(
28-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
29-
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
30-
"1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0");
31-
expectSum(
32-
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
33-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
34-
"1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0");
35-
expectSum(
36-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
37-
"a13fac3ee22b996ff6856c27c1f6d88aef0e",
38-
"d87c8de9e340aba6cb25ae8dbb531d2bc0105fa0");
39-
expectSum(
40-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
41-
"3fac3ee22b996ff6856c27c1f6d88aef0e",
42-
"d87bece9e340aba6cb25ae8dbb531d2bc0105fa0");
43-
expectSum(
44-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
45-
"ac3ee22b996ff6856c27c1f6d88aef0e",
46-
"d87becaae340aba6cb25ae8dbb531d2bc0105fa0");
47-
expectSum(
48-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
49-
"3ee22b996ff6856c27c1f6d88aef0e",
50-
"d87becaa3740aba6cb25ae8dbb531d2bc0105fa0");
51-
expectSum("d87becaa3701c97b31b5b8084f2b5b34e7857092", "1",
52-
"d87becaa3701c97b31b5b8084f2b5b34e7857093");
53-
expectSum("d87becaa3701c97b31b5b8084f2b5b34e7857092", "0",
54-
"d87becaa3701c97b31b5b8084f2b5b34e7857092");
28+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
29+
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
30+
"1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0",
31+
);
32+
expectSum(
33+
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
34+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
35+
"1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0",
36+
);
37+
expectSum(
38+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
39+
"a13fac3ee22b996ff6856c27c1f6d88aef0e",
40+
"d87c8de9e340aba6cb25ae8dbb531d2bc0105fa0",
41+
);
42+
expectSum(
43+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
44+
"3fac3ee22b996ff6856c27c1f6d88aef0e",
45+
"d87bece9e340aba6cb25ae8dbb531d2bc0105fa0",
46+
);
47+
expectSum(
48+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
49+
"ac3ee22b996ff6856c27c1f6d88aef0e",
50+
"d87becaae340aba6cb25ae8dbb531d2bc0105fa0",
51+
);
52+
expectSum(
53+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
54+
"3ee22b996ff6856c27c1f6d88aef0e",
55+
"d87becaa3740aba6cb25ae8dbb531d2bc0105fa0",
56+
);
57+
expectSum(
58+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
59+
"1",
60+
"d87becaa3701c97b31b5b8084f2b5b34e7857093",
61+
);
62+
expectSum(
63+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
64+
"0",
65+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
66+
);
5567

5668
expectSum(
57-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
58-
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
59-
"-3b04b6a8ac2e74f9845c182e303993e0efa8184");
60-
expectSum(
61-
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
62-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
63-
"3b04b6a8ac2e74f9845c182e303993e0efa8184");
64-
expectSum(
65-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
66-
"a13fac3ee22b996ff6856c27c1f6d88aef0e",
67-
"-d87b4b6a8ac2e74f9845c182e303993e0efa8184");
68-
expectSum(
69-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
70-
"3fac3ee22b996ff6856c27c1f6d88aef0e",
71-
"-d87bec6a8ac2e74f9845c182e303993e0efa8184");
72-
expectSum(
73-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
74-
"ac3ee22b996ff6856c27c1f6d88aef0e",
75-
"-d87beca98ac2e74f9845c182e303993e0efa8184");
76-
expectSum(
77-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
78-
"3ee22b996ff6856c27c1f6d88aef0e",
79-
"-d87becaa36c2e74f9845c182e303993e0efa8184");
80-
expectSum("-d87becaa3701c97b31b5b8084f2b5b34e7857092", "1",
81-
"-d87becaa3701c97b31b5b8084f2b5b34e7857091");
82-
expectSum("-d87becaa3701c97b31b5b8084f2b5b34e7857092", "0",
83-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092");
69+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
70+
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
71+
"-3b04b6a8ac2e74f9845c182e303993e0efa8184",
72+
);
73+
expectSum(
74+
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
75+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
76+
"3b04b6a8ac2e74f9845c182e303993e0efa8184",
77+
);
78+
expectSum(
79+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
80+
"a13fac3ee22b996ff6856c27c1f6d88aef0e",
81+
"-d87b4b6a8ac2e74f9845c182e303993e0efa8184",
82+
);
83+
expectSum(
84+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
85+
"3fac3ee22b996ff6856c27c1f6d88aef0e",
86+
"-d87bec6a8ac2e74f9845c182e303993e0efa8184",
87+
);
88+
expectSum(
89+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
90+
"ac3ee22b996ff6856c27c1f6d88aef0e",
91+
"-d87beca98ac2e74f9845c182e303993e0efa8184",
92+
);
93+
expectSum(
94+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
95+
"3ee22b996ff6856c27c1f6d88aef0e",
96+
"-d87becaa36c2e74f9845c182e303993e0efa8184",
97+
);
98+
expectSum(
99+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
100+
"1",
101+
"-d87becaa3701c97b31b5b8084f2b5b34e7857091",
102+
);
103+
expectSum(
104+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
105+
"0",
106+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
107+
);
84108

85109
expectSum(
86-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
87-
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
88-
"3b04b6a8ac2e74f9845c182e303993e0efa8184");
89-
expectSum(
90-
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
91-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
92-
"-3b04b6a8ac2e74f9845c182e303993e0efa8184");
93-
expectSum(
94-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
95-
"-a13fac3ee22b996ff6856c27c1f6d88aef0e",
96-
"d87b4b6a8ac2e74f9845c182e303993e0efa8184");
97-
expectSum(
98-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
99-
"-3fac3ee22b996ff6856c27c1f6d88aef0e",
100-
"d87bec6a8ac2e74f9845c182e303993e0efa8184");
101-
expectSum(
102-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
103-
"-ac3ee22b996ff6856c27c1f6d88aef0e",
104-
"d87beca98ac2e74f9845c182e303993e0efa8184");
105-
expectSum(
106-
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
107-
"-3ee22b996ff6856c27c1f6d88aef0e",
108-
"d87becaa36c2e74f9845c182e303993e0efa8184");
109-
expectSum("d87becaa3701c97b31b5b8084f2b5b34e7857092", "-1",
110-
"d87becaa3701c97b31b5b8084f2b5b34e7857091");
111-
expectSum("d87becaa3701c97b31b5b8084f2b5b34e7857092", "-0",
112-
"d87becaa3701c97b31b5b8084f2b5b34e7857092");
110+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
111+
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
112+
"3b04b6a8ac2e74f9845c182e303993e0efa8184",
113+
);
114+
expectSum(
115+
"d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
116+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
117+
"-3b04b6a8ac2e74f9845c182e303993e0efa8184",
118+
);
119+
expectSum(
120+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
121+
"-a13fac3ee22b996ff6856c27c1f6d88aef0e",
122+
"d87b4b6a8ac2e74f9845c182e303993e0efa8184",
123+
);
124+
expectSum(
125+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
126+
"-3fac3ee22b996ff6856c27c1f6d88aef0e",
127+
"d87bec6a8ac2e74f9845c182e303993e0efa8184",
128+
);
129+
expectSum(
130+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
131+
"-ac3ee22b996ff6856c27c1f6d88aef0e",
132+
"d87beca98ac2e74f9845c182e303993e0efa8184",
133+
);
134+
expectSum(
135+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
136+
"-3ee22b996ff6856c27c1f6d88aef0e",
137+
"d87becaa36c2e74f9845c182e303993e0efa8184",
138+
);
139+
expectSum(
140+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
141+
"-1",
142+
"d87becaa3701c97b31b5b8084f2b5b34e7857091",
143+
);
144+
expectSum(
145+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
146+
"-0",
147+
"d87becaa3701c97b31b5b8084f2b5b34e7857092",
148+
);
113149

114150
expectSum(
115-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
116-
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
117-
"-1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0");
118-
expectSum(
119-
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
120-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
121-
"-1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0");
122-
expectSum(
123-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
124-
"-a13fac3ee22b996ff6856c27c1f6d88aef0e",
125-
"-d87c8de9e340aba6cb25ae8dbb531d2bc0105fa0");
126-
expectSum(
127-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
128-
"-3fac3ee22b996ff6856c27c1f6d88aef0e",
129-
"-d87bece9e340aba6cb25ae8dbb531d2bc0105fa0");
130-
expectSum(
131-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
132-
"-ac3ee22b996ff6856c27c1f6d88aef0e",
133-
"-d87becaae340aba6cb25ae8dbb531d2bc0105fa0");
134-
expectSum(
135-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
136-
"-3ee22b996ff6856c27c1f6d88aef0e",
137-
"-d87becaa3740aba6cb25ae8dbb531d2bc0105fa0");
138-
expectSum("-d87becaa3701c97b31b5b8084f2b5b34e7857092", "-1",
139-
"-d87becaa3701c97b31b5b8084f2b5b34e7857093");
140-
expectSum("-d87becaa3701c97b31b5b8084f2b5b34e7857092", "-0",
141-
"-d87becaa3701c97b31b5b8084f2b5b34e7857092");
151+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
152+
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
153+
"-1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0",
154+
);
155+
expectSum(
156+
"-d4cba13fac3ee22b996ff6856c27c1f6d88aef0e",
157+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
158+
"-1ad478de9e340aba6cb25ae8dbb531d2bc0105fa0",
159+
);
160+
expectSum(
161+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
162+
"-a13fac3ee22b996ff6856c27c1f6d88aef0e",
163+
"-d87c8de9e340aba6cb25ae8dbb531d2bc0105fa0",
164+
);
165+
expectSum(
166+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
167+
"-3fac3ee22b996ff6856c27c1f6d88aef0e",
168+
"-d87bece9e340aba6cb25ae8dbb531d2bc0105fa0",
169+
);
170+
expectSum(
171+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
172+
"-ac3ee22b996ff6856c27c1f6d88aef0e",
173+
"-d87becaae340aba6cb25ae8dbb531d2bc0105fa0",
174+
);
175+
expectSum(
176+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
177+
"-3ee22b996ff6856c27c1f6d88aef0e",
178+
"-d87becaa3740aba6cb25ae8dbb531d2bc0105fa0",
179+
);
180+
expectSum(
181+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
182+
"-1",
183+
"-d87becaa3701c97b31b5b8084f2b5b34e7857093",
184+
);
185+
expectSum(
186+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
187+
"-0",
188+
"-d87becaa3701c97b31b5b8084f2b5b34e7857092",
189+
);
142190
}

tests/corelib/bigint_bitlength_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ void check(int length, BigInt base) {
4040

4141
if (debugPrint) {
4242
final printLength = length + 4;
43-
final nDigits =
44-
n.toUnsigned(printLength).toRadixString(2).padLeft(printLength);
43+
final nDigits = n
44+
.toUnsigned(printLength)
45+
.toRadixString(2)
46+
.padLeft(printLength);
4547
final mDigits = m.toUnsigned(printLength).toRadixString(2);
4648
print('$nDigits: $nLength');
4749
print('$mDigits: $mLength');

0 commit comments

Comments
 (0)