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

Unified Diff: test/async_memoizer_test.dart

Issue 1324743003: Add AsyncMemoizer.future. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Mark as -dev Created 5 years, 3 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
« lib/src/async_memoizer.dart ('K') | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/async_memoizer_test.dart
diff --git a/test/async_memoizer_test.dart b/test/async_memoizer_test.dart
index 3289aa96b7d934b84b45ce7b00d6a62c9338a207..b8ca38a10169ffeebf1730b83487b03982992a14 100644
--- a/test/async_memoizer_test.dart
+++ b/test/async_memoizer_test.dart
@@ -21,16 +21,19 @@ main() {
});
test("forwards the return value from the function", () async {
+ expect(cache.future, completion(equals("value")));
expect(cache.runOnce(() => "value"), completion(equals("value")));
expect(cache.runOnce(() {}), completion(equals("value")));
});
test("forwards the return value from an async function", () async {
+ expect(cache.future, completion(equals("value")));
expect(cache.runOnce(() async => "value"), completion(equals("value")));
expect(cache.runOnce(() {}), completion(equals("value")));
});
test("forwards the error from an async function", () async {
+ expect(cache.future, throwsA("error"));
expect(cache.runOnce(() async => throw "error"), throwsA("error"));
expect(cache.runOnce(() {}), throwsA("error"));
});
« lib/src/async_memoizer.dart ('K') | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698