@@ -151,61 +151,61 @@ dynamic expectAsync(Function f, {int count = 1}) {
151
151
}
152
152
153
153
// Matchers
154
- typedef Matcher = void Function (Object );
154
+ typedef Matcher = void Function (dynamic );
155
155
156
- Matcher same (Object o) => (v) {
156
+ Matcher same (dynamic o) => (v) {
157
157
Expect .identical (o, v);
158
158
};
159
159
160
- Matcher equals (Object o) => (v) {
160
+ Matcher equals (dynamic o) => (v) {
161
161
Expect .deepEquals (o, v);
162
162
};
163
163
164
- Matcher greaterThan (num n) => (Object v) {
164
+ Matcher greaterThan (num n) => (dynamic v) {
165
165
Expect .type <num >(v);
166
166
num value = v;
167
167
if (value > n) return ;
168
168
Expect .fail ("$v is not greater than $n " );
169
169
};
170
170
171
- Matcher greaterThanOrEqualTo (num n) => (Object v) {
171
+ Matcher greaterThanOrEqualTo (num n) => (dynamic v) {
172
172
Expect .type <num >(v);
173
173
num value = v;
174
174
if (value >= n) return ;
175
175
Expect .fail ("$v is not greater than $n " );
176
176
};
177
177
178
- Matcher lessThan (num n) => (Object v) {
178
+ Matcher lessThan (num n) => (dynamic v) {
179
179
Expect .type <num >(v);
180
180
num value = v;
181
181
if (value < n) return ;
182
182
Expect .fail ("$v is not less than $n " );
183
183
};
184
184
185
- Matcher lessThanOrEqualTo (num n) => (Object v) {
185
+ Matcher lessThanOrEqualTo (num n) => (dynamic v) {
186
186
Expect .type <num >(v);
187
187
num value = v;
188
188
if (value <= n) return ;
189
189
Expect .fail ("$v is not less than $n " );
190
190
};
191
191
192
- void isTrue (Object v) {
192
+ void isTrue (dynamic v) {
193
193
Expect .isTrue (v);
194
194
}
195
195
196
- void isFalse (Object v) {
196
+ void isFalse (dynamic v) {
197
197
Expect .isFalse (v);
198
198
}
199
199
200
- void isNull (Object o) {
200
+ void isNull (dynamic o) {
201
201
Expect .isNull (o);
202
202
}
203
203
204
- bool isStateError (Object o) {
204
+ bool isStateError (dynamic o) {
205
205
Expect .type <StateError >(o);
206
206
}
207
207
208
- void _checkThrow <T >(Object v, void onError (error)) {
208
+ void _checkThrow <T >(dynamic v, void onError (error)) {
209
209
if (v is Future ) {
210
210
var test = _currentTest..asyncWait ();
211
211
v.then ((_) {
@@ -223,17 +223,17 @@ void _checkThrow<T>(Object v, void onError(error)) {
223
223
});
224
224
}
225
225
226
- void throws (Object v) {
227
- _checkThrow <Object >(v, null );
226
+ void throws (dynamic v) {
227
+ _checkThrow <Object >(v, (_) {} );
228
228
}
229
229
230
- Matcher throwsA (matcher) => (Object o) {
231
- _checkThrow <Object >(o, (Object error) {
230
+ Matcher throwsA (matcher) => (dynamic o) {
231
+ _checkThrow <Object >(o, (error) {
232
232
expect (error, matcher);
233
233
});
234
234
};
235
235
236
- Matcher completion (matcher) => (Object o) {
236
+ Matcher completion (matcher) => (dynamic o) {
237
237
Expect .type <Future >(o);
238
238
Future future = o;
239
239
_currentTest.asyncWait ();
@@ -243,7 +243,7 @@ Matcher completion(matcher) => (Object o) {
243
243
});
244
244
};
245
245
246
- void completes (Object o) {
246
+ void completes (dynamic o) {
247
247
Expect .type <Future >(o);
248
248
Future future = o;
249
249
_currentTest.asyncWait ();
@@ -252,30 +252,30 @@ void completes(Object o) {
252
252
});
253
253
}
254
254
255
- void isMap (Object o) {
255
+ void isMap (dynamic o) {
256
256
Expect .type <Map >(o);
257
257
}
258
258
259
- void isList (Object o) {
259
+ void isList (dynamic o) {
260
260
Expect .type <List >(o);
261
261
}
262
262
263
- void isNotNull (Object o) {
263
+ void isNotNull (dynamic o) {
264
264
Expect .isNotNull (o);
265
265
}
266
266
267
267
abstract class _Matcher {
268
- void call (Object o);
268
+ void call (dynamic o);
269
269
}
270
270
271
271
class isInstanceOf< T > implements _Matcher {
272
- void call (Object o) {
272
+ void call (dynamic o) {
273
273
Expect .type <T >(o);
274
274
}
275
275
}
276
276
277
- void throwsArgumentError (Object v) {
278
- _checkThrow <ArgumentError >(v, null );
277
+ void throwsArgumentError (dynamic v) {
278
+ _checkThrow <ArgumentError >(v, (_) {} );
279
279
}
280
280
281
281
String fail (String message) {
0 commit comments