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

Unified Diff: test/pool_test.dart

Issue 1853273002: Don't use async/await for Pool.withResource(). (Closed) Base URL: git@github.com:dart-lang/pool@master
Patch Set: Created 4 years, 8 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 | « pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/pool_test.dart
diff --git a/test/pool_test.dart b/test/pool_test.dart
index 91e6833105fb56ea681ad42e2826f97f5dfd029b..bd44cb275caff6e966e28dc89fdd631969f5a12e 100644
--- a/test/pool_test.dart
+++ b/test/pool_test.dart
@@ -96,6 +96,13 @@ void main() {
async.elapse(new Duration(seconds: 1));
});
});
+
+ // Regression test for #3.
+ test("can be called immediately before close()", () async {
+ var pool = new Pool(1);
+ pool.withResource(expectAsync(() {}));
+ await pool.close();
+ });
});
group("with a timeout", () {
@@ -276,7 +283,7 @@ void main() {
test("disallows request() and withResource()", () {
var pool = new Pool(1)..close();
expect(pool.request, throwsStateError);
- expect(pool.withResource(() {}), throwsStateError);
+ expect(() => pool.withResource(() {}), throwsStateError);
});
test("pending requests are fulfilled", () async {
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698