Skip to content

Commit 361cf93

Browse files
munificentCommit Queue
authored andcommitted
Reformat tests/language/a-e using 3.8 style.
Change-Id: I5cfab9212bb78809967de323b60ebb06913b84d1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425149 Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]>
1 parent a02d5bb commit 361cf93

File tree

40 files changed

+170
-180
lines changed

40 files changed

+170
-180
lines changed

tests/language/abstract/getter2_test.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,15 @@ void main() {
5252
/// Tests that overriding either the getter or setter with an abstract member
5353
/// has no effect.
5454
/// Regression test for https://github.com/dart-lang/sdk/issues/29914
55-
var c1 =
56-
AbstractGetterOverride1()
57-
..foo = 123
58-
..bar = 456;
55+
var c1 = AbstractGetterOverride1()
56+
..foo = 123
57+
..bar = 456;
5958
Expect.equals(c1.foo, 123);
6059
Expect.equals(c1.bar, 456);
6160

62-
var c2 =
63-
AbstractGetterOverride2()
64-
..foo = 123
65-
..bar = 456;
61+
var c2 = AbstractGetterOverride2()
62+
..foo = 123
63+
..bar = 456;
6664
Expect.equals(c2.foo, 123);
6765
Expect.equals(c2.bar, 456);
6866
}

tests/language/assert/initializer_test.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,13 @@ void test(int x, int y) {
9696
bool assertionsEnabled = false;
9797
assert(assertionsEnabled = true);
9898

99-
void Function(C Function()) doTest =
100-
(assertionsEnabled && x >= y)
101-
? (f) {
102-
Expect.throwsAssertionError(f);
103-
}
104-
: (f) {
105-
Expect.equals(x, f().x);
106-
};
99+
void Function(C Function()) doTest = (assertionsEnabled && x >= y)
100+
? (f) {
101+
Expect.throwsAssertionError(f);
102+
}
103+
: (f) {
104+
Expect.equals(x, f().x);
105+
};
107106

108107
doTest(() => new C.c01(x, y));
109108
doTest(() => new C.c02(x, y));

tests/language/async/congruence_unnamed_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ main() {
106106
}
107107
};
108108

109-
Future<A> Function() f_expressionSyntax_B =
110-
() async => false ? new A() : new B();
109+
Future<A> Function() f_expressionSyntax_B = () async =>
110+
false ? new A() : new B();
111111

112-
Future<A> Function() f_expressionSyntax_FutureB =
113-
() async => false ? futureA() : futureB();
112+
Future<A> Function() f_expressionSyntax_FutureB = () async =>
113+
false ? futureA() : futureB();
114114

115115
// Not executed
116116
void checkStaticTypes() {

tests/language/await/await_with_no_context_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ main() async {
5656

5757
// Target of a property set
5858
(await ((null as Future<B>?) ??
59-
(Future.value(C())..expectStaticType<Exactly<Future<C>>>())))
60-
.prop = 0;
59+
(Future.value(C())..expectStaticType<Exactly<Future<C>>>())))
60+
.prop =
61+
0;
6162

6263
// Target of a property get
6364
(await ((null as Future<B>?) ??

tests/language/call/implicit_tearoff_exceptions_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void testIfNull() {
113113
bFalse
114114
? d
115115
: ((c ?? a) // ignore: dead_null_aware_expression
116-
..expectStaticType<Exactly<A>>()),
116+
..expectStaticType<Exactly<A>>()),
117117
),
118118
);
119119

@@ -132,7 +132,7 @@ void testIfNull() {
132132
bFalse
133133
? d
134134
: (((c) ?? a) // ignore: dead_null_aware_expression
135-
..expectStaticType<Exactly<A>>()),
135+
..expectStaticType<Exactly<A>>()),
136136
),
137137
);
138138
Expect.throws(
@@ -145,7 +145,7 @@ void testIfNull() {
145145
bFalse
146146
? d
147147
: ((((c)) ?? a) // ignore: dead_null_aware_expression
148-
..expectStaticType<Exactly<A>>()),
148+
..expectStaticType<Exactly<A>>()),
149149
),
150150
);
151151
Expect.throws(

tests/language/cascade/in_expression_function_test.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55

66
import "package:expect/expect.dart";
77

8-
makeMap() =>
9-
new Map()
10-
..[3] = 4
11-
..[0] = 11;
8+
makeMap() => new Map()
9+
..[3] = 4
10+
..[0] = 11;
1211

1312
class MyClass {
14-
foo() =>
15-
this
16-
..bar(3)
17-
..baz(4);
13+
foo() => this
14+
..bar(3)
15+
..baz(4);
1816
bar(x) => x;
1917
baz(y) => y * 2;
2018
}

tests/language/cascade/in_initializer_list_test.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ class B {
1414
final y;
1515

1616
B(a)
17-
: x =
18-
a
19-
..foo()
20-
..bar(),
21-
y =
22-
a
23-
..foo()
24-
..bar() {}
17+
: x = a
18+
..foo()
19+
..bar(),
20+
y = a
21+
..foo()
22+
..bar() {}
2523
}
2624

2725
main() {

tests/language/cascade/nested_test.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ class Bar {
1414
}
1515

1616
main() {
17-
var bar =
18-
new Bar()
19-
..foo = (new Foo()..x = 42)
20-
..y = 38;
17+
var bar = new Bar()
18+
..foo = (new Foo()..x = 42)
19+
..y = 38;
2120
Expect.isTrue(bar is Bar);
2221
Expect.isTrue(bar.foo is Foo);
2322
Expect.equals(bar.foo.x, 42);

tests/language/cascade/on_static_field_test.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
final List<String> list =
6-
[]
7-
..add("foo")
8-
..add("bar")
9-
..add("baz");
5+
final List<String> list = []
6+
..add("foo")
7+
..add("bar")
8+
..add("baz");
109

1110
main() {
1211
print(list);

tests/language/cascade/precedence_test.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,17 @@ main() {
171171
Box originalBox = box;
172172
// Should parse as:
173173
// box = (box..x = (a.value == 21 ? b : c)..x.test(117));
174-
box =
175-
box
176-
..x = a.value == 21 ? b : c
177-
..x.test(117);
174+
box = box
175+
..x = a.value == 21 ? b : c
176+
..x.test(117);
178177
Expect.equals(originalBox, box);
179178
Expect.equals(box.value, b);
180179

181180
// New cascades are allowed inside an expressionWithoutCascade if properly
182181
// delimited.
183182
box
184-
..x =
185-
(a
186-
..set(42)
187-
..test(42))
183+
..x = (a
184+
..set(42)
185+
..test(42))
188186
..x.test(42);
189187
}

0 commit comments

Comments
 (0)