Fix missing_return violation newly enforced in Dart ~2.3.2-dev.0.1
diff --git a/test/async_cache_test.dart b/test/async_cache_test.dart
index 92e34bf..5474a37 100644
--- a/test/async_cache_test.dart
+++ b/test/async_cache_test.dart
@@ -22,7 +22,7 @@
test('should not fetch via callback when a cache exists', () async {
await cache.fetch(() async => 'Expensive');
- expect(await cache.fetch(expectAsync0(() {}, count: 0)), 'Expensive');
+ expect(await cache.fetch(expectAsync0(() => null, count: 0)), 'Expensive');
});
test('should not fetch via callback when a future is in-flight', () async {
@@ -31,7 +31,7 @@
var completer = Completer<String>();
expect(cache.fetch(() => completer.future), completion('Expensive'));
- expect(cache.fetch(expectAsync0(() {}, count: 0)), completion('Expensive'));
+ expect(cache.fetch(expectAsync0(() => null, count: 0)), completion('Expensive'));
completer.complete('Expensive');
});
@@ -78,7 +78,7 @@
yield '2';
yield '3';
}).toList();
- expect(await cache.fetchStream(expectAsync0(() {}, count: 0)).toList(),
+ expect(await cache.fetchStream(expectAsync0(() => null, count: 0)).toList(),
['1', '2', '3']);
});
diff --git a/test/cancelable_operation_test.dart b/test/cancelable_operation_test.dart
index a4c9308..a47e952 100644
--- a/test/cancelable_operation_test.dart
+++ b/test/cancelable_operation_test.dart
@@ -251,9 +251,9 @@
setUp(() {
// Initialize all functions to ones that expect to not be called.
- onValue = expectAsync1((_) {}, count: 0, id: "onValue");
- onError = expectAsync2((e, s) {}, count: 0, id: "onError");
- onCancel = expectAsync0(() {}, count: 0, id: "onCancel");
+ onValue = expectAsync1((_) => null, count: 0, id: "onValue");
+ onError = expectAsync2((e, s) => null, count: 0, id: "onError");
+ onCancel = expectAsync0(() => null, count: 0, id: "onCancel");
propagateCancel = false;
});
diff --git a/test/stream_queue_test.dart b/test/stream_queue_test.dart
index aaf1227..b2a8625 100644
--- a/test/stream_queue_test.dart
+++ b/test/stream_queue_test.dart
@@ -254,6 +254,7 @@
expect(value, expectedValue);
expect(index, sequenceIndex);
index++;
+ return null;
};
await Future.wait([
skip1.then(sequence(0, 0)),
diff --git a/test/subscription_transformer_test.dart b/test/subscription_transformer_test.dart
index 2a709a4..64f45ec 100644
--- a/test/subscription_transformer_test.dart
+++ b/test/subscription_transformer_test.dart
@@ -90,6 +90,7 @@
subscriptionTransformer(handleCancel: expectAsync1((inner) {
callbackInvoked = true;
inner.cancel();
+ return null;
}))).listen(expectAsync1((_) {}, count: 0));
await flushMicrotasks();
@@ -251,7 +252,7 @@
setUp(() {
var controller = StreamController();
subscription = controller.stream
- .transform(subscriptionTransformer(handleCancel: (_) {}))
+ .transform(subscriptionTransformer(handleCancel: (_) => null))
.listen(expectAsync1((_) {}, count: 0),
onError: expectAsync2((_, __) {}, count: 0),
onDone: expectAsync0(() {}, count: 0));