Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1295)

Unified Diff: test/typed_wrapper/future_test.dart

Issue 2161283002: Fix Dart 1.17 strong-mode warnings. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/subscription_stream_test.dart ('k') | test/typed_wrapper/stream_subscription_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/typed_wrapper/future_test.dart
diff --git a/test/typed_wrapper/future_test.dart b/test/typed_wrapper/future_test.dart
index 6601ac1aa9e5a7c81dae19a5c63a91e4aeb55c7d..b3ff0a70348f1edddfb8dc2dc7b3278faed67a3f 100644
--- a/test/typed_wrapper/future_test.dart
+++ b/test/typed_wrapper/future_test.dart
@@ -4,7 +4,6 @@
import 'dart:async';
-import "package:async/async.dart";
import "package:async/src/typed/future.dart";
import "package:test/test.dart";
@@ -13,7 +12,7 @@ import '../utils.dart';
void main() {
group("with valid types, forwards", () {
var wrapper;
- var errorWrapper;
+ TypeSafeFuture<int> errorWrapper;
setUp(() {
wrapper = new TypeSafeFuture<int>(new Future<Object>.value(12));
@@ -35,11 +34,11 @@ void main() {
expect(errorWrapper.catchError(expectAsync((error) {
expect(error, equals("oh no"));
- return "value";
+ return 42;
}), test: expectAsync((error) {
expect(error, equals("oh no"));
return true;
- })), completion(equals("value")));
+ })), completion(equals(42)));
});
test("then()", () {
@@ -71,7 +70,7 @@ void main() {
});
group("with invalid types", () {
- var wrapper;
+ TypeSafeFuture<int> wrapper;
setUp(() {
wrapper = new TypeSafeFuture<int>(new Future<Object>.value("foo"));
});
@@ -104,14 +103,5 @@ void main() {
throwsCastError);
});
});
-
- group("doesn't throw a CastError for", () {
- test("catchError()", () {
- // catchError has a Future<dynamic> return type, so even if there's no
- // error we don't re-wrap the returned future.
- expect(wrapper.catchError(expectAsync((_) {}, count: 0)),
- completion(equals("foo")));
- });
- });
});
}
« no previous file with comments | « test/subscription_stream_test.dart ('k') | test/typed_wrapper/stream_subscription_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698