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

Side by Side Diff: pkg/matcher/lib/src/future_matchers.dart

Issue 629113002: Adjusting matcher comments with one-line summaries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merging master Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/matcher/lib/src/expect.dart ('k') | pkg/matcher/lib/src/iterable_matchers.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 matcher.future_matchers; 5 library matcher.future_matchers;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'expect.dart'; 9 import 'expect.dart';
10 import 'interfaces.dart'; 10 import 'interfaces.dart';
11 import 'util.dart'; 11 import 'util.dart';
12 12
13 /// Matches a [Future] that completes successfully with a value. Note that this 13 /// Matches a [Future] that completes successfully with a value.
14 /// creates an asynchronous expectation. The call to `expect()` that includes 14 ///
15 /// this will return immediately and execution will continue. Later, when the 15 /// Note that this creates an asynchronous expectation. The call to `expect()`
16 /// future completes, the actual expectation will run. 16 /// that includes this will return immediately and execution will continue.
17 /// Later, when the future completes, the actual expectation will run.
17 /// 18 ///
18 /// To test that a Future completes with an exception, you can use [throws] and 19 /// To test that a Future completes with an exception, you can use [throws] and
19 /// [throwsA]. 20 /// [throwsA].
20 final Matcher completes = const _Completes(null, ''); 21 final Matcher completes = const _Completes(null, '');
21 22
22 /// Matches a [Future] that completes succesfully with a value that matches 23 /// Matches a [Future] that completes succesfully with a value that matches
23 /// [matcher]. Note that this creates an asynchronous expectation. The call to 24 /// [matcher].
25 ///
26 /// Note that this creates an asynchronous expectation. The call to
24 /// `expect()` that includes this will return immediately and execution will 27 /// `expect()` that includes this will return immediately and execution will
25 /// continue. Later, when the future completes, the actual expectation will run. 28 /// continue. Later, when the future completes, the actual expectation will run.
26 /// 29 ///
27 /// To test that a Future completes with an exception, you can use [throws] and 30 /// To test that a Future completes with an exception, you can use [throws] and
28 /// [throwsA]. 31 /// [throwsA].
29 /// 32 ///
30 /// [id] is an optional tag that can be used to identify the completion matcher 33 /// [id] is an optional tag that can be used to identify the completion matcher
31 /// in error messages. 34 /// in error messages.
32 Matcher completion(matcher, [String id = '']) => 35 Matcher completion(matcher, [String id = '']) =>
33 new _Completes(wrapMatcher(matcher), id); 36 new _Completes(wrapMatcher(matcher), id);
(...skipping 27 matching lines...) Expand all
61 64
62 Description describe(Description description) { 65 Description describe(Description description) {
63 if (_matcher == null) { 66 if (_matcher == null) {
64 description.add('completes successfully'); 67 description.add('completes successfully');
65 } else { 68 } else {
66 description.add('completes to a value that ').addDescriptionOf(_matcher); 69 description.add('completes to a value that ').addDescriptionOf(_matcher);
67 } 70 }
68 return description; 71 return description;
69 } 72 }
70 } 73 }
OLDNEW
« no previous file with comments | « pkg/matcher/lib/src/expect.dart ('k') | pkg/matcher/lib/src/iterable_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698