Skip to content

Commit 361cf93

Browse files
munificentCommit Queue
authored and
Commit Queue
committed
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

+6-8
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

+7-8
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

+4-4
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

+3-2
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

+3-3
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

+6-8
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

+6-8
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

+3-4
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

+4-5
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

+6-8
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
}

tests/language/class/cyclic_class_member_test.dart

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// Test that class with a cyclic hierarchy doesn't cause a loop in dart2js.
66

77
class A extends A {
8-
// ^
9-
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
10-
// [cfe] 'A' is a supertype of itself.
8+
// ^
9+
// [analyzer] COMPILE_TIME_ERROR.RECURSIVE_INTERFACE_INHERITANCE
10+
// [cfe] 'A' is a supertype of itself.
1111

1212
// When checking that foo isn't overriding an instance method in the
1313
// superclass, dart2js might loop.

tests/language/class_modifiers/base/base_class_extend_not_base_final_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ class BOutside extends BaseClass {}
1616
// ^^^^^^^^
1717
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
1818
// [cfe] The type 'BOutside' must be 'base', 'final' or 'sealed' because the supertype 'BaseClass' is 'base'.
19-

tests/language/class_modifiers/base/base_class_implement_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ enum EnumOutside implements ClassForEnum { x }
2222
// ^^^^^^^^^^^^
2323
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
2424
// [cfe] The class 'ClassForEnum' can't be implemented outside of its library because it's a base class.
25-

tests/language/class_modifiers/base/base_class_inside_not_base_final_sealed_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ class IndirectSubtype extends SubtypeOfBase {}
6868
// ^^^^^^^^^^^^^^^
6969
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
7070
// [cfe] The type 'IndirectSubtype' must be 'base', 'final' or 'sealed' because the supertype 'BaseClass' is 'base'.
71-

tests/language/class_modifiers/base/base_mixin_implement_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ enum EnumOutside implements MixinForEnum { x }
2222
// ^^^^^^^^^^^^
2323
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
2424
// [cfe] The mixin 'MixinForEnum' can't be implemented outside of its library because it's a base mixin.
25-

tests/language/class_modifiers/base/base_mixin_with_not_base_final_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ class BOutside with BaseMixin {}
1616
// ^^^^^^^^
1717
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
1818
// [cfe] The type 'BOutside' must be 'base', 'final' or 'sealed' because the supertype 'BaseMixin' is 'base'.
19-

tests/language/class_modifiers/final/final_class_implement_outside_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ enum EnumOutside implements ClassForEnum { x }
2222
// ^^^^^^^^^^^^
2323
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
2424
// [cfe] The class 'ClassForEnum' can't be implemented outside of its library because it's a final class.
25-

tests/language/class_modifiers/final/final_class_inside_not_base_final_sealed_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ class IndirectSubtype extends SubtypeOfFinal {}
4949
// ^^^^^^^^^^^^^^^
5050
// [analyzer] COMPILE_TIME_ERROR.SUBTYPE_OF_BASE_OR_FINAL_IS_NOT_BASE_FINAL_OR_SEALED
5151
// [cfe] The type 'IndirectSubtype' must be 'base', 'final' or 'sealed' because the supertype 'FinalClass' is 'final'.
52-

tests/language/class_modifiers/interface/interface_class_typedef_extend_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ class ATypeDef extends InterfaceClassTypeDef {}
1111
// ^^^^^^^^^^^^^^^^^^^^^
1212
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
1313
// [cfe] The class 'InterfaceClass' can't be extended outside of its library because it's an interface class.
14-

tests/language/class_modifiers/interface/interface_class_typedef_used_outside_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,3 @@ class A extends ATypeDef {}
1414
// ^^^^^^^^
1515
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
1616
// [cfe] The class 'InterfaceClass' can't be extended outside of its library because it's an interface class.
17-

tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_generative_constructor_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ abstract class AbstractClassMixingCtorClass with GenerativeConstructorClass {}
1818
// [cfe] Can't use 'GenerativeConstructorClass' as a mixin because it has constructors.
1919
// ^^^^^^^^^^^^^^^^^^^^^^^^^^
2020
// [analyzer] COMPILE_TIME_ERROR.MIXIN_CLASS_DECLARES_CONSTRUCTOR
21-

tests/language/class_modifiers/mixin/mixin_class_no_modifier_old_version_superclass_not_object_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ abstract class AbstractMixinClass with NonObjectSuperclassClass {}
1818
// ^^^^^^^^^^^^^^^^^^^^^^^^
1919
// [analyzer] COMPILE_TIME_ERROR.MIXIN_INHERITS_FROM_NOT_OBJECT
2020
// [cfe] The class 'NonObjectSuperclassClass' can't be used as a mixin because it extends a class other than 'Object'.
21-

tests/language/class_modifiers/mixin/mixin_class_no_modifier_outside_library_error_test.dart

-1
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,3 @@ class OutsideG with AbstractClass {}
4040
// ^^^^^^^^^^^^^
4141
// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
4242
// [cfe] The class 'AbstractClass' can't be used as a mixin because it isn't a mixin class nor a mixin.
43-

tests/language/closure/closures_with_complex_params_test.dart

+4-6
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ test3() {
4747
var f2 = (Pair<int, Pair<int, int>> pr) => pr.snd.fst + 2;
4848

4949
// Closures with function type with nested parameterized types.
50-
var ap1 =
51-
(f(Pair<int, Pair<int, int>> pr1), Pair<int, Pair<int, int>> pr) =>
52-
f(pr) * 10;
53-
var ap2 =
54-
(f(Pair<int, Pair<int, int>> pr1), Pair<int, Pair<int, int>> pr) =>
55-
f(pr) * 100;
50+
var ap1 = (f(Pair<int, Pair<int, int>> pr1), Pair<int, Pair<int, int>> pr) =>
51+
f(pr) * 10;
52+
var ap2 = (f(Pair<int, Pair<int, int>> pr1), Pair<int, Pair<int, int>> pr) =>
53+
f(pr) * 100;
5654

5755
var e = new Pair<int, Pair<int, int>>(100, new Pair<int, int>(200, 300));
5856

tests/language/closure/with_super_field_test.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ class A {
1212
class B extends A {
1313
int get a => 54;
1414
returnSuper() => super.a;
15-
returnSuperInClosure() => () => super.a;
15+
returnSuperInClosure() =>
16+
() => super.a;
1617
}
1718

1819
main() {

tests/language/compile_time_constant/compile_time_constant11_test.dart

+10-12
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,19 @@ import "package:expect/expect.dart";
99
const C1 = true;
1010
const C2 = false;
1111

12-
const nephew =
13-
C1
14-
? C2
15-
? "Tick"
16-
: "Trick"
17-
: "Track";
12+
const nephew = C1
13+
? C2
14+
? "Tick"
15+
: "Trick"
16+
: "Track";
1817

1918
main() {
2019
const a = true ? 5 : 10;
21-
const b =
22-
C2
23-
? "Track"
24-
: C1
25-
? "Trick"
26-
: "Tick";
20+
const b = C2
21+
? "Track"
22+
: C1
23+
? "Trick"
24+
: "Tick";
2725

2826
Expect.equals(5, a);
2927
Expect.equals("Trick", nephew);

tests/language/const/instantiated_function_constant_test.dart

+5-6
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ class A<U extends num> {
5959
x3 = b ? ((b ? prefix.f1 : f2))<U> : ((b ? prefix.f1 : f2))<int>,
6060
x4 = b ? ((b ? c01 : prefix.c02))<U> : ((b ? c01 : prefix.c02))<int>,
6161
x5 = b ? (null ?? f1)<U> : (null ?? f1)<int>,
62-
x6 =
63-
b
64-
? ((c01 as dynamic)
65-
as void Function<X extends num>(X, [num, List<X>]))<U>
66-
: ((c01 as dynamic)
67-
as void Function<X extends num>(X, [num, List<X>]))<int>,
62+
x6 = b
63+
? ((c01 as dynamic)
64+
as void Function<X extends num>(X, [num, List<X>]))<U>
65+
: ((c01 as dynamic)
66+
as void Function<X extends num>(X, [num, List<X>]))<int>,
6867
x7 = b ? f1 : f2,
6968
x8 = b ? c01 : c02,
7069
x9 = null ?? c02,

tests/language/constants_2018/type_check_test.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ class T {
2929
const T.length2(dynamic l, int defaultValue)
3030
: value = l is! String ? defaultValue : l.length;
3131
const T.sum(dynamic o1, dynamic o2)
32-
: value =
33-
((o1 is num) & (o2 is num)) | ((o1 is String) & (o2 is String))
34-
? o1 + o2
35-
: o1;
32+
: value = ((o1 is num) & (o2 is num)) | ((o1 is String) & (o2 is String))
33+
? o1 + o2
34+
: o1;
3635
}
3736

3837
class C {

0 commit comments

Comments
 (0)