@@ -55,15 +55,15 @@ void main() {
55
55
test ("can be called freely up to the limit" , () {
56
56
var pool = new Pool (50 );
57
57
for (var i = 0 ; i < 50 ; i++ ) {
58
- pool.withResource (expectAsync (() => new Completer ().future));
58
+ pool.withResource (expectAsync0 (() => new Completer ().future));
59
59
}
60
60
});
61
61
62
62
test ("blocks the callback past the limit" , () {
63
63
new FakeAsync ().run ((async ) {
64
64
var pool = new Pool (50 );
65
65
for (var i = 0 ; i < 50 ; i++ ) {
66
- pool.withResource (expectAsync (() => new Completer ().future));
66
+ pool.withResource (expectAsync0 (() => new Completer ().future));
67
67
}
68
68
pool.withResource (expectNoAsync ());
69
69
@@ -75,7 +75,7 @@ void main() {
75
75
new FakeAsync ().run ((async ) {
76
76
var pool = new Pool (50 );
77
77
for (var i = 0 ; i < 49 ; i++ ) {
78
- pool.withResource (expectAsync (() => new Completer ().future));
78
+ pool.withResource (expectAsync0 (() => new Completer ().future));
79
79
}
80
80
81
81
var completer = new Completer ();
@@ -100,7 +100,7 @@ void main() {
100
100
// Regression test for #3.
101
101
test ("can be called immediately before close()" , () async {
102
102
var pool = new Pool (1 );
103
- pool.withResource (expectAsync (() {}));
103
+ pool.withResource (expectAsync0 (() {}));
104
104
await pool.close ();
105
105
});
106
106
});
@@ -160,7 +160,7 @@ void main() {
160
160
for (var i = 0 ; i < 50 ; i++ ) {
161
161
expect (pool.request (), completes);
162
162
}
163
- expect (pool.request (), throwsA (new isInstanceOf <TimeoutException >()));
163
+ expect (pool.request (), throwsA (new TypeMatcher <TimeoutException >()));
164
164
165
165
async .elapse (new Duration (seconds: 6 ));
166
166
});
@@ -270,7 +270,7 @@ void main() {
270
270
var innerZone = Zone .current;
271
271
expect (innerZone, isNot (equals (outerZone)));
272
272
273
- resource.allowRelease (expectAsync (() {
273
+ resource.allowRelease (expectAsync0 (() {
274
274
expect (Zone .current, equals (innerZone));
275
275
}));
276
276
});
@@ -450,7 +450,7 @@ Function expectNoAsync() {
450
450
///
451
451
/// This should only be called within a [FakeAsync.run] zone.
452
452
Matcher get doesNotComplete => predicate ((future) {
453
- expect (future, new isInstanceOf <Future >());
453
+ expect (future, new TypeMatcher <Future >());
454
454
455
455
var stack = new Trace .current (1 );
456
456
future.then ((_) => registerException (
0 commit comments