Skip to content

Commit a0a4d1e

Browse files
authored
Update to latest version of lints (#2140)
Remove a <R> type parameter from checks that seems unused
1 parent 8ba0940 commit a0a4d1e

21 files changed

+60
-47
lines changed

integration_tests/spawn_hybrid/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dependencies:
77
path: ^1.8.2
88
stream_channel: ^2.1.0
99
dev_dependencies:
10-
lints: '>=1.0.0 <3.0.0'
10+
dart_flutter_team_lints: ^2.0.0
1111
other_package:
1212
path: other_package/
1313
test: any

integration_tests/spawn_hybrid/test/hybrid_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void main() {
6262
test('emits an error from the stream channel if the isolate fails to load',
6363
() {
6464
expect(spawnHybridUri('non existent file').stream.first,
65-
throwsA(TypeMatcher<Exception>()));
65+
throwsA(isA<Exception>()));
6666
});
6767
});
6868

@@ -215,7 +215,7 @@ void main() {
215215
}
216216
''');
217217

218-
expect(channel.stream.first, throwsA(TypeMatcher<TestFailure>()));
218+
expect(channel.stream.first, throwsA(isA<TestFailure>()));
219219
});
220220

221221
test('gracefully handles an unserializable message in the VM', () {
@@ -225,7 +225,7 @@ void main() {
225225
void hybridMain(StreamChannel channel) {}
226226
''');
227227

228-
expect(() => channel.sink.add([].iterator), throwsArgumentError);
228+
expect(() => channel.sink.add(<Object>[].iterator), throwsArgumentError);
229229
});
230230

231231
test('gracefully handles an unserializable message in the browser',
@@ -236,7 +236,7 @@ void main() {
236236
void hybridMain(StreamChannel channel) {}
237237
''');
238238

239-
expect(() => channel.sink.add([].iterator), throwsArgumentError);
239+
expect(() => channel.sink.add(<Object>[].iterator), throwsArgumentError);
240240
}, testOn: 'browser');
241241

242242
test('gracefully handles an unserializable message in the hybrid isolate',

integration_tests/spawn_hybrid/test/hybrid_test_io.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library;
7+
68
import 'dart:io';
79

810
import 'package:path/path.dart' as p;
@@ -29,7 +31,7 @@ void main() {
2931
// isolate closes).
3032
var port = await channel.stream.first as int;
3133
var socket = await Socket.connect('localhost', port);
32-
expect(socket.listen(null).asFuture(), completes);
34+
expect(socket.listen(null).asFuture<void>(), completes);
3335

3436
await channel.sink.close();
3537
});

integration_tests/spawn_hybrid/test/subdir/hybrid_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
@TestOn('vm')
6+
library;
7+
68
import 'package:test/test.dart';
79

810
void main() {

pkgs/checks/lib/src/checks.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ abstract final class Context<T> {
433433
/// }
434434
/// }
435435
/// ```
436-
Future<void> expectAsync<R>(Iterable<String> Function() clause,
436+
Future<void> expectAsync(Iterable<String> Function() clause,
437437
FutureOr<Rejection?> Function(T) predicate);
438438

439439
/// Expect that [predicate] will not invoke the passed callback with a
@@ -710,7 +710,7 @@ final class _TestContext<T> implements Context<T>, _ClauseDescription {
710710
}
711711

712712
@override
713-
Future<void> expectAsync<R>(Iterable<String> Function() clause,
713+
Future<void> expectAsync(Iterable<String> Function() clause,
714714
FutureOr<Rejection?> Function(T) predicate) async {
715715
if (!_allowAsync) {
716716
throw StateError(
@@ -841,7 +841,7 @@ final class _SkippedContext<T> implements Context<T> {
841841
}
842842

843843
@override
844-
Future<void> expectAsync<R>(Iterable<String> Function() clause,
844+
Future<void> expectAsync(Iterable<String> Function() clause,
845845
FutureOr<Rejection?> Function(T) predicate) async {
846846
// no-op
847847
}

pkgs/checks/lib/src/collection_equality.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'dart:collection';
66

7-
import 'package:checks/context.dart';
7+
import '../context.dart';
88

99
/// Returns a descriptive `which` for a rejection if the elements of [actual]
1010
/// are unequal to the elements of [expected].

pkgs/checks/lib/src/extensions/async.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import 'dart:async';
66
import 'dart:convert';
77

88
import 'package:async/async.dart';
9-
import 'package:checks/context.dart';
9+
10+
import '../../context.dart';
1011

1112
extension FutureChecks<T> on Subject<Future<T>> {
1213
/// Expects that the `Future` completes to a value without throwing.
@@ -46,7 +47,7 @@ extension FutureChecks<T> on Subject<Future<T>> {
4647
unawaited(actual.then((r) {
4748
reject(Rejection(
4849
actual: prefixFirst('a future that completed to ', literal(r))));
49-
}, onError: (e, st) {
50+
}, onError: (Object e, StackTrace st) {
5051
reject(Rejection(actual: [
5152
'a future that completed as an error:'
5253
], which: [

pkgs/checks/lib/src/extensions/core.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
import 'dart:convert';
66

7-
import 'package:checks/context.dart';
87
import 'package:meta/meta.dart' as meta;
98

9+
import '../../context.dart';
10+
1011
extension CoreChecks<T> on Subject<T> {
1112
/// Extracts a property of the value for further expectations.
1213
///

pkgs/checks/lib/src/extensions/function.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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-
import 'package:checks/context.dart';
5+
import '../../context.dart';
66

77
extension FunctionChecks<T> on Subject<T Function()> {
88
/// Expects that a function throws synchronously when it is called.

pkgs/checks/lib/src/extensions/iterable.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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-
import 'package:checks/context.dart';
5+
import '../../context.dart';
66

77
import '../collection_equality.dart';
88
import 'core.dart';

0 commit comments

Comments
 (0)