Skip to content

Commit b22fb56

Browse files
authored
Update test.yaml and format testing/ directory. (dart-lang#2719)
1 parent b320ee8 commit b22fb56

File tree

13 files changed

+43
-40
lines changed

13 files changed

+43
-40
lines changed

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
#COVERAGE_TOKEN: true # this needs to be set to enable coverage
5656
- name: ${{ matrix.job }}
5757
if: runner.os == 'Windows' && matrix.job == 'main'
58-
run: pub run grinder buildbot
58+
run: dart run grinder buildbot
5959
env:
6060
DARTDOC_BOT: ${{ matrix.job }}
6161
# - id: coverage

testing/test_package/lib/dart.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/// A bold name for a library to test comment reference resolution.
2-
library Dart;
2+
library Dart;

testing/test_package/lib/example.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ class aThingToDo {
5959
}
6060

6161
const ConstantCat MY_CAT = const ConstantCat('tabby');
62-
const List<String> PRETTY_COLORS = const <String>[COLOR_GREEN, COLOR_ORANGE, 'blue'];
62+
const List<String> PRETTY_COLORS = const <String>[
63+
COLOR_GREEN,
64+
COLOR_ORANGE,
65+
'blue'
66+
];
6367
@deprecated
6468
int deprecatedField;
6569

testing/test_package/lib/fake.dart

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,7 @@ enum MacrosFromAccessors {
997997
/// {@category NotSoExcellent}
998998
class SubForDocComments extends BaseForDocComments {
999999
SubForDocComments(bool thing) : super(thing);
1000-
1000+
10011001
/// Reference to [foo] and [bar]
10021002
void localMethod(String foo, bar) {}
10031003

@@ -1257,7 +1257,6 @@ abstract class IntermediateAbstract extends Object {
12571257
/// This should inherit [==] from [IntermediateAbstract].
12581258
class IntermediateAbstractSubclass extends IntermediateAbstract {}
12591259

1260-
12611260
/// Test parameter comment resolution in factory constructors and methods.
12621261
class FactoryConstructorThings {
12631262
bool aName;
@@ -1286,10 +1285,12 @@ class FactoryConstructorThings {
12861285
void aMethod(bool yetAnotherName) {}
12871286
}
12881287

1288+
DTypeParam
1289+
aTopLevelTypeParameterFunction<DTypeParam extends TypeParameterThings>(
1290+
DTypeParam typedParam) {}
12891291

1290-
DTypeParam aTopLevelTypeParameterFunction<DTypeParam extends TypeParameterThings>(DTypeParam typedParam) {}
1291-
1292-
abstract class TypeParameterThings<ATypeParam, BTypeParam extends FactoryConstructorThings> {
1292+
abstract class TypeParameterThings<ATypeParam,
1293+
BTypeParam extends FactoryConstructorThings> {
12931294
ATypeParam aName;
12941295
List<BTypeParam> aThing;
12951296

@@ -1299,18 +1300,26 @@ abstract class TypeParameterThings<ATypeParam, BTypeParam extends FactoryConstru
12991300

13001301
/// Test that inheriting documentation can still reference parent type
13011302
/// parameters.
1302-
class TypeParameterThingsExtended extends TypeParameterThings<String, FactoryConstructorThings> {
1303+
class TypeParameterThingsExtended
1304+
extends TypeParameterThings<String, FactoryConstructorThings> {
13031305
@override
1304-
FactoryConstructorThings aMethod<QTypeParam>(String aParam, QTypeParam anotherParam) => null;
1306+
FactoryConstructorThings aMethod<QTypeParam>(
1307+
String aParam, QTypeParam anotherParam) =>
1308+
null;
13051309
}
13061310

13071311
/// Test that overriding documentation uses local type parameters.
1308-
class TypeParameterThingsExtendedQ extends TypeParameterThings<String, FactoryConstructorThings> {
1312+
class TypeParameterThingsExtendedQ
1313+
extends TypeParameterThings<String, FactoryConstructorThings> {
13091314
@override
1315+
13101316
/// I override documentation so I can reference [QTypeParam].
1311-
FactoryConstructorThings aMethod<QTypeParam>(String aParam, QTypeParam anotherParam) => null;
1317+
FactoryConstructorThings aMethod<QTypeParam>(
1318+
String aParam, QTypeParam anotherParam) =>
1319+
null;
13121320
}
13131321

13141322
/// We should still be able to reference [fParam.fParamA], [fParam.fParamB],
13151323
/// and [fParam.fParamC].
1316-
void set aSetterWithFunctionParameter(bool fParam(int fParamA, String fParamB, String fParamC)) {}
1324+
void set aSetterWithFunctionParameter(
1325+
bool fParam(int fParamA, String fParamB, String fParamC)) {}

testing/test_package/lib/set_literals.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const untypedMap = const {};
66
const typedSet = const <String>{};
77
const untypedMapWithoutConst = {};
88

9-
109
class AClassContainingLiterals {
1110
final int value1;
1211
final int value2;

testing/test_package/lib/src/base.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import 'local_scope.dart';
88

99
class BaseClass extends WithGetterAndSetter {}
1010

11-
12-
1311
class BaseWithMembers {
1412
int aField;
1513

@@ -24,4 +22,4 @@ class BaseWithMembers {
2422
BaseWithMembers() {}
2523

2624
BaseWithMembers.aConstructor() {}
27-
}
25+
}

testing/test_package/lib/src/extending.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ bool someConflictingNameSymbol;
1515
/// Linking over to [Apple] should work.
1616
class ExtendingClass extends BaseClass {}
1717

18-
19-
2018
class ExtendingAgain extends BaseWithMembers {
2119
@override
2220
bool anotherField;
23-
}
21+
}

testing/test_package/lib/src/local_scope.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
/// Imported by a library but not reexported.
44
library two_exports.src.local_scope;
55

6-
76
String aNotReexportedVariable;
87

9-
bool anotherNotReexportedVariable;
8+
bool anotherNotReexportedVariable;

testing/test_package/lib/two_exports.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ library two_exports;
88
export 'src/base.dart';
99
export 'src/extending.dart' hide someConflictingNameSymbol;
1010

11-
1211
int aSymbolOnlyAvailableInExportContext;
1312

14-
bool someConflictingNameSymbol;
13+
bool someConflictingNameSymbol;

testing/test_package_experiments/lib/generic_functions_as_type_args.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ extension EB<T extends F> on T {
4545
// Can be used as arguments to metadata too.
4646
@C<F>(f)
4747
@CB<FB<F>>(fb)
48-
void main() {}
48+
void main() {}

testing/test_package_experiments/lib/generic_metadata.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,11 @@ mixin M<@A<B>(0) T> {
202202

203203
@A<B>(0)
204204
enum En {
205-
@A<B>(0)
206-
foo
205+
@A<B>(0)
206+
foo
207207
}
208208

209209
@A<B>(0)
210210
typedef F<@A<B>(0) T> = int Function<@A<B>(0) X>(@A<B>(0) int);
211211

212-
void main() {
213-
}
212+
void main() {}

testing/test_package_experiments/lib/triple_shift.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class C {
99
static int ctr = 0;
1010

1111
/// Check that constants using a triple shift operator appear correctly.
12-
static const int constantTripleShifted = 3>>>5;
12+
static const int constantTripleShifted = 3 >>> 5;
1313
final Object? _text;
1414
C([Object? text]) : _text = text ?? "${++ctr}";
1515

@@ -22,7 +22,7 @@ class C {
2222
C operator >>(arg) => C("(${++ctr}:$_text>>$arg)");
2323
C operator <<(arg) => C("(${++ctr}:$_text<<$arg)");
2424
// & binds less strongly than `>>`, `>>>` and `<<`.
25-
C operator &(arg) => C("(${++ctr}:$_text&$arg)");
25+
C operator &(arg) => C("(${++ctr}:$_text&$arg)");
2626

2727
String toString() => "${_text}";
2828
}
@@ -39,4 +39,4 @@ class F extends E {
3939
// Valid in extensions too.
4040
extension ShiftIt<T> on T {
4141
List<T> operator >>>(int count) => List<T>.filled(count, this);
42-
}
42+
}

testing/test_package_extensions/lib/main.dart

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ extension AnExtension on Apple {
1919
/// Extension on List
2020
extension FancyList<Z> on List<Z> {
2121
int get doubleLength => this.length * 2;
22-
List<Z> operator-() => this.reversed.toList();
22+
List<Z> operator -() => this.reversed.toList();
2323
List<List<Z>> split(int at) =>
24-
<List<Z>>[this.sublist(0, at), this.sublist(at)];
24+
<List<Z>>[this.sublist(0, at), this.sublist(at)];
2525
static List<Z> big() => List(1000000);
2626
}
2727

2828
extension SymDiff<T> on Set<T> {
2929
Set<T> symmetricDifference(Set<T> other) =>
30-
this.difference(other).union(other.difference(this));
30+
this.difference(other).union(other.difference(this));
3131
}
3232

3333
/// Extensions can be made specific.
@@ -37,16 +37,14 @@ extension IntSet on Set<int> {
3737

3838
// Extensions can be private.
3939
extension _Shhh on Object {
40-
void secret() { }
40+
void secret() {}
4141
}
4242

4343
// Or unnamed!
4444
extension on Object {
45-
void bar() { }
45+
void bar() {}
4646
}
4747

4848
extension Bar on Object {
49-
void bar() { }
49+
void bar() {}
5050
}
51-
52-

0 commit comments

Comments
 (0)