Skip to content

Update test.yaml and format testing/ directory. #2719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
#COVERAGE_TOKEN: true # this needs to be set to enable coverage
- name: ${{ matrix.job }}
if: runner.os == 'Windows' && matrix.job == 'main'
run: pub run grinder buildbot
run: dart run grinder buildbot
env:
DARTDOC_BOT: ${{ matrix.job }}
# - id: coverage
Expand Down
2 changes: 1 addition & 1 deletion testing/test_package/lib/dart.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/// A bold name for a library to test comment reference resolution.
library Dart;
library Dart;
6 changes: 5 additions & 1 deletion testing/test_package/lib/example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ class aThingToDo {
}

const ConstantCat MY_CAT = const ConstantCat('tabby');
const List<String> PRETTY_COLORS = const <String>[COLOR_GREEN, COLOR_ORANGE, 'blue'];
const List<String> PRETTY_COLORS = const <String>[
COLOR_GREEN,
COLOR_ORANGE,
'blue'
];
@deprecated
int deprecatedField;

Expand Down
29 changes: 19 additions & 10 deletions testing/test_package/lib/fake.dart
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ enum MacrosFromAccessors {
/// {@category NotSoExcellent}
class SubForDocComments extends BaseForDocComments {
SubForDocComments(bool thing) : super(thing);

/// Reference to [foo] and [bar]
void localMethod(String foo, bar) {}

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


/// Test parameter comment resolution in factory constructors and methods.
class FactoryConstructorThings {
bool aName;
Expand Down Expand Up @@ -1286,10 +1285,12 @@ class FactoryConstructorThings {
void aMethod(bool yetAnotherName) {}
}

DTypeParam
aTopLevelTypeParameterFunction<DTypeParam extends TypeParameterThings>(
DTypeParam typedParam) {}

DTypeParam aTopLevelTypeParameterFunction<DTypeParam extends TypeParameterThings>(DTypeParam typedParam) {}

abstract class TypeParameterThings<ATypeParam, BTypeParam extends FactoryConstructorThings> {
abstract class TypeParameterThings<ATypeParam,
BTypeParam extends FactoryConstructorThings> {
ATypeParam aName;
List<BTypeParam> aThing;

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

/// Test that inheriting documentation can still reference parent type
/// parameters.
class TypeParameterThingsExtended extends TypeParameterThings<String, FactoryConstructorThings> {
class TypeParameterThingsExtended
extends TypeParameterThings<String, FactoryConstructorThings> {
@override
FactoryConstructorThings aMethod<QTypeParam>(String aParam, QTypeParam anotherParam) => null;
FactoryConstructorThings aMethod<QTypeParam>(
String aParam, QTypeParam anotherParam) =>
null;
}

/// Test that overriding documentation uses local type parameters.
class TypeParameterThingsExtendedQ extends TypeParameterThings<String, FactoryConstructorThings> {
class TypeParameterThingsExtendedQ
extends TypeParameterThings<String, FactoryConstructorThings> {
@override

/// I override documentation so I can reference [QTypeParam].
FactoryConstructorThings aMethod<QTypeParam>(String aParam, QTypeParam anotherParam) => null;
FactoryConstructorThings aMethod<QTypeParam>(
String aParam, QTypeParam anotherParam) =>
null;
}

/// We should still be able to reference [fParam.fParamA], [fParam.fParamB],
/// and [fParam.fParamC].
void set aSetterWithFunctionParameter(bool fParam(int fParamA, String fParamB, String fParamC)) {}
void set aSetterWithFunctionParameter(
bool fParam(int fParamA, String fParamB, String fParamC)) {}
1 change: 0 additions & 1 deletion testing/test_package/lib/set_literals.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const untypedMap = const {};
const typedSet = const <String>{};
const untypedMapWithoutConst = {};


class AClassContainingLiterals {
final int value1;
final int value2;
Expand Down
4 changes: 1 addition & 3 deletions testing/test_package/lib/src/base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import 'local_scope.dart';

class BaseClass extends WithGetterAndSetter {}



class BaseWithMembers {
int aField;

Expand All @@ -24,4 +22,4 @@ class BaseWithMembers {
BaseWithMembers() {}

BaseWithMembers.aConstructor() {}
}
}
4 changes: 1 addition & 3 deletions testing/test_package/lib/src/extending.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ bool someConflictingNameSymbol;
/// Linking over to [Apple] should work.
class ExtendingClass extends BaseClass {}



class ExtendingAgain extends BaseWithMembers {
@override
bool anotherField;
}
}
3 changes: 1 addition & 2 deletions testing/test_package/lib/src/local_scope.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/// Imported by a library but not reexported.
library two_exports.src.local_scope;


String aNotReexportedVariable;

bool anotherNotReexportedVariable;
bool anotherNotReexportedVariable;
3 changes: 1 addition & 2 deletions testing/test_package/lib/two_exports.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ library two_exports;
export 'src/base.dart';
export 'src/extending.dart' hide someConflictingNameSymbol;


int aSymbolOnlyAvailableInExportContext;

bool someConflictingNameSymbol;
bool someConflictingNameSymbol;
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ extension EB<T extends F> on T {
// Can be used as arguments to metadata too.
@C<F>(f)
@CB<FB<F>>(fb)
void main() {}
void main() {}
7 changes: 3 additions & 4 deletions testing/test_package_experiments/lib/generic_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,11 @@ mixin M<@A<B>(0) T> {

@A<B>(0)
enum En {
@A<B>(0)
foo
@A<B>(0)
foo
}

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

void main() {
}
void main() {}
6 changes: 3 additions & 3 deletions testing/test_package_experiments/lib/triple_shift.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class C {
static int ctr = 0;

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

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

String toString() => "${_text}";
}
Expand All @@ -39,4 +39,4 @@ class F extends E {
// Valid in extensions too.
extension ShiftIt<T> on T {
List<T> operator >>>(int count) => List<T>.filled(count, this);
}
}
14 changes: 6 additions & 8 deletions testing/test_package_extensions/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ extension AnExtension on Apple {
/// Extension on List
extension FancyList<Z> on List<Z> {
int get doubleLength => this.length * 2;
List<Z> operator-() => this.reversed.toList();
List<Z> operator -() => this.reversed.toList();
List<List<Z>> split(int at) =>
<List<Z>>[this.sublist(0, at), this.sublist(at)];
<List<Z>>[this.sublist(0, at), this.sublist(at)];
static List<Z> big() => List(1000000);
}

extension SymDiff<T> on Set<T> {
Set<T> symmetricDifference(Set<T> other) =>
this.difference(other).union(other.difference(this));
this.difference(other).union(other.difference(this));
}

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

// Extensions can be private.
extension _Shhh on Object {
void secret() { }
void secret() {}
}

// Or unnamed!
extension on Object {
void bar() { }
void bar() {}
}

extension Bar on Object {
void bar() { }
void bar() {}
}