OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library unittest.future_matchers; | 5 library unittest.frontend.future_matchers; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:matcher/matcher.dart' hide throws, throwsA, expect, fail; | 9 import 'package:matcher/matcher.dart' hide throws, throwsA, expect, fail; |
10 | 10 |
| 11 import '../backend/invoker.dart'; |
| 12 import '../utils.dart'; |
11 import 'expect.dart'; | 13 import 'expect.dart'; |
12 import 'invoker.dart'; | |
13 import 'utils.dart'; | |
14 | 14 |
15 /// Matches a [Future] that completes successfully with a value. | 15 /// Matches a [Future] that completes successfully with a value. |
16 /// | 16 /// |
17 /// Note that this creates an asynchronous expectation. The call to `expect()` | 17 /// Note that this creates an asynchronous expectation. The call to `expect()` |
18 /// that includes this will return immediately and execution will continue. | 18 /// that includes this will return immediately and execution will continue. |
19 /// Later, when the future completes, the actual expectation will run. | 19 /// Later, when the future completes, the actual expectation will run. |
20 /// | 20 /// |
21 /// To test that a Future completes with an exception, you can use [throws] and | 21 /// To test that a Future completes with an exception, you can use [throws] and |
22 /// [throwsA]. | 22 /// [throwsA]. |
23 final Matcher completes = const _Completes(null, ''); | 23 final Matcher completes = const _Completes(null, ''); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 Description describe(Description description) { | 73 Description describe(Description description) { |
74 if (_matcher == null) { | 74 if (_matcher == null) { |
75 description.add('completes successfully'); | 75 description.add('completes successfully'); |
76 } else { | 76 } else { |
77 description.add('completes to a value that ').addDescriptionOf(_matcher); | 77 description.add('completes to a value that ').addDescriptionOf(_matcher); |
78 } | 78 } |
79 return description; | 79 return description; |
80 } | 80 } |
81 } | 81 } |
OLD | NEW |