Skip to content

Commit c9d54c1

Browse files
munificentCommit Queue
authored and
Commit Queue
committed
Reformat tests/language/s** using 3.8 style.
Change-Id: I3c5cfbc1bc5e41d2ef1598427067dea00f9f42b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425403 Reviewed-by: Lasse Nielsen <[email protected]> Commit-Queue: Lasse Nielsen <[email protected]> Auto-Submit: Bob Nystrom <[email protected]>
1 parent 200e0c8 commit c9d54c1

File tree

98 files changed

+2263
-1718
lines changed

Some content is hidden

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

98 files changed

+2263
-1718
lines changed

tests/language/scaling/medium_offset_type_parameter_test.dart

Lines changed: 516 additions & 514 deletions
Large diffs are not rendered by default.

tests/language/script/script1_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
part "script1_part.dart";
88
import "script1_lib.dart";
9-
// [error line 8, column 1, length 6]
9+
// [error column 1, length 6]
1010
// [analyzer] SYNTACTIC_ERROR.IMPORT_DIRECTIVE_AFTER_PART_DIRECTIVE
1111
// [cfe] Import directives must precede part directives.
1212

tests/language/sealed_class/sealed_class_as_mixin_error_test.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ abstract class OutsideA with SealedClass {}
1414
// [cfe] The class 'SealedClass' can't be used as a mixin because it isn't a mixin class nor a mixin.
1515

1616
class OutsideB with SealedClass {
17-
// ^^^^^^^^^^^
18-
// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
19-
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
20-
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
21-
// [cfe] The class 'SealedClass' can't be used as a mixin because it isn't a mixin class nor a mixin.
17+
// ^^^^^^^^^^^
18+
// [analyzer] COMPILE_TIME_ERROR.CLASS_USED_AS_MIXIN
19+
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
20+
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
21+
// [cfe] The class 'SealedClass' can't be used as a mixin because it isn't a mixin class nor a mixin.
2222
int foo = 2;
2323
int bar(int value) => value;
2424
}
@@ -46,3 +46,4 @@ abstract class OutsideE with Mixin, SealedClass {}
4646
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
4747
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
4848
// [cfe] The class 'SealedClass' can't be used as a mixin because it isn't a mixin class nor a mixin.
49+

tests/language/sealed_class/sealed_class_extend_error_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ abstract class OutsideA extends SealedClass {}
1212
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
1313

1414
class OutsideB extends SealedClass {
15-
// ^^^^^^^^^^^
16-
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
17-
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
15+
// ^^^^^^^^^^^
16+
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
17+
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
1818
int foo = 2;
1919
int bar(int value) => value;
2020
}

tests/language/sealed_class/sealed_class_implement_error_test.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ abstract class OutsideA implements SealedClass {}
1212
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
1313

1414
class OutsideB implements SealedClass {
15-
// ^^^^^^^^^^^
16-
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
17-
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
15+
// ^^^^^^^^^^^
16+
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
17+
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
1818
int nonAbstractFoo = 2;
1919
int foo = 2;
2020
int nonAbstractBar(int value) => value;
@@ -30,3 +30,4 @@ enum EnumOutside implements ClassForEnum { x }
3030
// ^^^^^^^^^^^^
3131
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
3232
// [cfe] The class 'ClassForEnum' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
33+

tests/language/sealed_class/sealed_class_typedef_error_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class ATypeDef extends SealedClassTypeDef {}
1313
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
1414

1515
class BTypeDef implements SealedClassTypeDef {
16-
// ^^^^^^^^^^^^^^^^^^
17-
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
18-
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
16+
// ^^^^^^^^^^^^^^^^^^
17+
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
18+
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
1919
int foo = 1;
2020
}

tests/language/sealed_class/sealed_class_typedef_used_outside_error_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class A extends ATypeDef {}
1616
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
1717

1818
class B implements ATypeDef {
19-
// ^^^^^^^^
20-
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
21-
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
19+
// ^^^^^^^^
20+
// [analyzer] COMPILE_TIME_ERROR.INVALID_USE_OF_TYPE_OUTSIDE_LIBRARY
21+
// [cfe] The class 'SealedClass' can't be extended, implemented, or mixed in outside of its library because it's a sealed class.
2222
int foo = 1;
2323
}

tests/language/set_literals/const_set_literal_test.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,25 @@ void test() {
7070
checkSet<Symbol>(const {#foo, #bar}, [#foo, #bar]);
7171
checkSet<Symbol>(const {#_foo, #_bar}, [#_foo, #_bar]);
7272
const object = Object();
73-
checkSet<Object>(const {#foo, 1, "string", object, true},
74-
[#foo, 1, "string", object, true]);
73+
checkSet<Object>(
74+
const {#foo, 1, "string", object, true},
75+
[#foo, 1, "string", object, true],
76+
);
7577

7678
// Nested constant literals.
77-
const Object o = {{2}};
79+
const Object o = {
80+
{2},
81+
};
7882
Expect.type<Set<Set<int>>>(o);
7983
Set<Set<int>> set = o as Set<Set<int>>;
8084
Expect.equals(1, set.length);
8185
Expect.equals(1, set.first.length);
8286
Expect.equals(2, set.first.first);
8387

84-
const Object o2 = {{2}, <int>{}};
88+
const Object o2 = {
89+
{2},
90+
<int>{},
91+
};
8592
Expect.type<Set<Set<int>>>(o);
8693
set = o2 as Set<Set<int>>;
8794
Expect.equals(2, set.length);
@@ -97,7 +104,10 @@ void test() {
97104
Expect.equals(1, o4.length);
98105
Expect.equals(0, o4.first.length);
99106

100-
const o5 = {{1}, {}}; // Set<Object>
107+
const o5 = {
108+
{1},
109+
{},
110+
}; // Set<Object>
101111
Expect.type<Set<Object>>(o5);
102112
Expect.notType<Set<Set<Object>>>(o5);
103113

tests/language/set_literals/in_annotations_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class A<@Meta({}) T> {
2626
@Meta({})
2727
enum E {
2828
@Meta({})
29-
v
29+
v,
3030
}
3131

3232
class Meta {

tests/language/set_literals/set_literal_test.dart

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,28 @@ void test() {
7979
entries.add(entry);
8080
return value;
8181
}
82+
8283
checkSet<Equality>(
83-
{log(e1a, 1), log(e2b, 2), log(e1b, 3), log(e2a, 4)}, [e1a, e2b]);
84+
{log(e1a, 1), log(e2b, 2), log(e1b, 3), log(e2a, 4)},
85+
[e1a, e2b],
86+
);
8487
Expect.listEquals([1, 2, 3, 4], entries);
8588

8689
// Nested literals.
87-
Object o = {{2}};
90+
Object o = {
91+
{2},
92+
};
8893
Expect.type<LinkedHashSet<Set<int>>>(o);
8994
Expect.type<LinkedHashSet<int>>((o as Set).first);
9095
Set<Set<int>> set = o as Set<Set<int>>;
9196
Expect.equals(1, set.length);
9297
Expect.equals(1, set.first.length);
9398
Expect.equals(2, set.first.first);
9499

95-
o = {{2}, <int>{}};
100+
o = {
101+
{2},
102+
<int>{},
103+
};
96104
Expect.type<LinkedHashSet<Set<int>>>(o);
97105
Expect.type<LinkedHashSet<int>>((o as Set).first);
98106
set = o as Set<Set<int>>;
@@ -105,17 +113,26 @@ void test() {
105113
Expect.equals(1, set2.length);
106114
Expect.equals(0, set2.first.length);
107115

108-
var set3 = {{1}, {}}; // Set<Object>
116+
var set3 = {
117+
{1},
118+
{},
119+
}; // Set<Object>
109120
Expect.type<Set<Object>>(set3);
110121
Expect.notType<Set<Set<Object>>>(set3);
111122

112123
// Trailing comma.
113124
Iterable<Object> i;
125+
// Don't let the formatter remove the trailing commas.
126+
// dart format off
114127
i = {1,};
128+
// dart format on
115129
Expect.type<Set<Object>>(i);
116130
Expect.equals(1, i.length);
117131

132+
// Don't let the formatter remove the trailing commas.
133+
// dart format off
118134
Object o2 = {1, 2, 3,};
135+
// dart format on
119136
Expect.type<Set<int>>(o2);
120137
Set<Object> set4 = o2 as Set<Object>;
121138
Expect.equals(3, set4.length);
@@ -126,6 +143,6 @@ class Equality {
126143
final String name;
127144
const Equality(this.id, this.name);
128145
int get hashCode => id;
129-
bool operator==(Object other) => other is Equality && id == other.id;
146+
bool operator ==(Object other) => other is Equality && id == other.id;
130147
String toString() => "$id:$name";
131148
}

tests/language/setter/declaration_test.dart

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ set tooMany(var value, var extra) {}
1818
// ^
1919
// [cfe] A setter should have exactly one formal parameter.
2020

21-
/*space*/ int? set wrongReturnType1(_) => 1;
22-
// ^^^^
21+
int? set wrongReturnType1(_) => 1;
22+
// [error column 1, length 4]
2323
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
2424
// [cfe] The return type of the setter must be 'void' or absent.
2525

26-
/*space*/ FutureOr<void> set wrongReturnType2(_) {}
27-
// ^^^^^^^^^^^^^^
26+
FutureOr<void> set wrongReturnType2(_) {}
27+
// [error column 1, length 14]
2828
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
2929
// [cfe] The return type of the setter must be 'void' or absent.
3030

31-
/*space*/ Never set wrongReturnType3(_) => throw 1;
32-
// ^^^^^
31+
Never set wrongReturnType3(_) => throw 1;
32+
// [error column 1, length 5]
3333
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
3434
// [cfe] The return type of the setter must be 'void' or absent.
3535

@@ -73,18 +73,18 @@ class C {
7373
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
7474
// [cfe] The return type of the setter must be 'void' or absent.
7575

76-
/*space*/ int? set wrongReturnType1(_) => 1;
77-
// ^^^^
76+
int? set wrongReturnType1(_) => 1;
77+
// [error column 3, length 4]
7878
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
7979
// [cfe] The return type of the setter must be 'void' or absent.
8080

81-
/*space*/ FutureOr<void> set wrongReturnType2(_) {}
82-
// ^^^^^^^^^^^^^^
81+
FutureOr<void> set wrongReturnType2(_) {}
82+
// [error column 3, length 14]
8383
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
8484
// [cfe] The return type of the setter must be 'void' or absent.
8585

86-
/*space*/ Never set wrongReturnType3(_) => throw 1;
87-
// ^^^^^
86+
Never set wrongReturnType3(_) => throw 1;
87+
// [error column 3, length 5]
8888
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
8989
// [cfe] The return type of the setter must be 'void' or absent.
9090

tests/language/setter/no_getter_call_runtime_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import "package:expect/expect.dart";
99

1010
var topLevelClosure;
1111

12-
1312
get topLevel => topLevelClosure;
1413

1514
set topLevel(var value) {}

tests/language/setter/no_getter_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ class Example {
1010

1111
main() {
1212
print(topLevel++);
13-
// ^
14-
// [analyzer] unspecified
13+
// ^^^^^^^^
14+
// [analyzer] COMPILE_TIME_ERROR.UNDEFINED_IDENTIFIER
1515
// [cfe] Getter not found: 'topLevel'.
1616

1717
Example ex = new Example();

tests/language/setter/setter3_runtime_test.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
class A {
1313
set foo(x) {}
1414
void set bar(x) {}
15-
16-
1715
}
1816

1917
main() {

tests/language/setter/setter3_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ class A {
1010
set foo(x) {}
1111
void set bar(x) {}
1212
dynamic set baz(x) {}
13-
//^^^^^^^
14-
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
15-
// [cfe] The return type of the setter must be 'void' or absent.
13+
// [error column 3, length 7]
14+
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
15+
// [cfe] The return type of the setter must be 'void' or absent.
1616
bool set bob(x) {}
17-
//^^^^
18-
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
19-
// [cfe] The return type of the setter must be 'void' or absent.
17+
// [error column 3, length 4]
18+
// [analyzer] COMPILE_TIME_ERROR.NON_VOID_RETURN_FOR_SETTER
19+
// [cfe] The return type of the setter must be 'void' or absent.
2020
}
2121

2222
main() {

tests/language/spread_collections/await_test.dart

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ Future<void> testList() async {
2727
Expect.listEquals(list, [...await future12, 3, ...await future45]);
2828

2929
// Await in null-aware spread.
30-
Expect.listEquals(
31-
list, [...?await nullableFuture12, 3, ...?await futureNull, 4, 5]);
30+
Expect.listEquals(list, [
31+
...?await nullableFuture12,
32+
3,
33+
...?await futureNull,
34+
4,
35+
5,
36+
]);
3237
}
3338

3439
Future<void> testMap() async {
@@ -41,8 +46,13 @@ Future<void> testMap() async {
4146
Expect.mapEquals(map, {...await future12, 3: 3, ...await future45});
4247

4348
// Await in null-aware spread.
44-
Expect.mapEquals(map,
45-
{...?await nullableFuture12, 3: 3, ...?await futureNull, 4: 4, 5: 5});
49+
Expect.mapEquals(map, {
50+
...?await nullableFuture12,
51+
3: 3,
52+
...?await futureNull,
53+
4: 4,
54+
5: 5,
55+
});
4656
}
4757

4858
Future<void> testSet() async {
@@ -55,6 +65,11 @@ Future<void> testSet() async {
5565
Expect.setEquals(set, {...await future12, 3, ...await future45});
5666

5767
// Await in null-aware spread.
58-
Expect.setEquals(
59-
set, {...?await nullableFuture12, 3, ...?await futureNull, 4, 5});
68+
Expect.setEquals(set, {
69+
...?await nullableFuture12,
70+
3,
71+
...?await futureNull,
72+
4,
73+
5,
74+
});
6075
}

0 commit comments

Comments
 (0)