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

Side by Side Diff: pkg/scheduled_test/lib/src/scheduled_future_matchers.dart

Issue 17090006: Change MatchState to Map. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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/oauth2/test/utils.dart ('k') | no next file » | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 scheduled_future_matchers; 5 library scheduled_future_matchers;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:stack_trace/stack_trace.dart'; 9 import 'package:stack_trace/stack_trace.dart';
10 10
(...skipping 28 matching lines...) Expand all
39 /// the [expect]'s error message. 39 /// the [expect]'s error message.
40 Matcher completion(matcher, [String description]) => 40 Matcher completion(matcher, [String description]) =>
41 new _ScheduledCompletes(wrapMatcher(matcher), description); 41 new _ScheduledCompletes(wrapMatcher(matcher), description);
42 42
43 class _ScheduledCompletes extends BaseMatcher { 43 class _ScheduledCompletes extends BaseMatcher {
44 final Matcher _matcher; 44 final Matcher _matcher;
45 final String _description; 45 final String _description;
46 46
47 const _ScheduledCompletes(this._matcher, this._description); 47 const _ScheduledCompletes(this._matcher, this._description);
48 48
49 bool matches(item, MatchState matchState) { 49 bool matches(item, Map matchState) {
50 if (item is! Future) return false; 50 if (item is! Future) return false;
51 51
52 // TODO(nweiz): parse the stack, figure out on what line these were called, 52 // TODO(nweiz): parse the stack, figure out on what line these were called,
53 // and include that in their descriptions 53 // and include that in their descriptions
54 var description = _description; 54 var description = _description;
55 if (description == null) { 55 if (description == null) {
56 if (_matcher == null) { 56 if (_matcher == null) {
57 description = 'expect(..., completes)'; 57 description = 'expect(..., completes)';
58 } else { 58 } else {
59 var matcherDescription = new StringDescription(); 59 var matcherDescription = new StringDescription();
(...skipping 17 matching lines...) Expand all
77 77
78 Description describe(Description description) { 78 Description describe(Description description) {
79 if (_matcher == null) { 79 if (_matcher == null) {
80 description.add('completes successfully'); 80 description.add('completes successfully');
81 } else { 81 } else {
82 description.add('completes to a value that ').addDescriptionOf(_matcher); 82 description.add('completes to a value that ').addDescriptionOf(_matcher);
83 } 83 }
84 return description; 84 return description;
85 } 85 }
86 } 86 }
OLDNEW
« no previous file with comments | « pkg/oauth2/test/utils.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698