Skip to content

Commit c9d54c1

Browse files
munificentCommit Queue
authored andcommitted
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
}

0 commit comments

Comments
 (0)