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

Side by Side Diff: pkg/mock/lib/src/log_entry_list.dart

Issue 278613003: pkg/mock: fixes for v0.11 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: status file fix for mismatched version constraints Created 6 years, 7 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/mock/lib/src/behavior.dart ('k') | pkg/mock/lib/src/mock.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 mock.log_entry_list; 5 library mock.log_entry_list;
6 6
7 import 'package:matcher/matcher.dart'; 7 import 'package:matcher/matcher.dart';
8 8
9 import 'call_matcher.dart'; 9 import 'call_matcher.dart';
10 import 'log_entry.dart'; 10 import 'log_entry.dart';
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 } 94 }
95 return rtn; 95 return rtn;
96 } 96 }
97 97
98 /** Apply a unit test [Matcher] to the [LogEntryList]. */ 98 /** Apply a unit test [Matcher] to the [LogEntryList]. */
99 LogEntryList verify(Matcher matcher) { 99 LogEntryList verify(Matcher matcher) {
100 if (_mockFailureHandler == null) { 100 if (_mockFailureHandler == null) {
101 _mockFailureHandler = 101 _mockFailureHandler =
102 new _MockFailureHandler(getOrCreateExpectFailureHandler()); 102 new _MockFailureHandler(getOrCreateExpectFailureHandler());
103 } 103 }
104 expect(logs, matcher, reason:filter, failureHandler: _mockFailureHandler); 104 expect(logs, matcher, reason: filter, failureHandler: _mockFailureHandler);
105 return this; 105 return this;
106 } 106 }
107 107
108 /** 108 /**
109 * Iterate through the list and call the [validator] function with the 109 * Iterate through the list and call the [validator] function with the
110 * log [List] and position. The [validator] should return the number of 110 * log [List] and position. The [validator] should return the number of
111 * positions to advance upon success, or zero upon failure. When zero is 111 * positions to advance upon success, or zero upon failure. When zero is
112 * returned an error is reported. [reason] can be used to provide a 112 * returned an error is reported. [reason] can be used to provide a
113 * more descriptive failure message. If a failure occurred false will be 113 * more descriptive failure message. If a failure occurred false will be
114 * returned (unless the failure handler itself threw an exception); 114 * returned (unless the failure handler itself threw an exception);
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 * that was used to select the logs that were verified. 555 * that was used to select the logs that were verified.
556 */ 556 */
557 String _mockingErrorFormatter(actual, Matcher matcher, String signature, 557 String _mockingErrorFormatter(actual, Matcher matcher, String signature,
558 Map matchState, bool verbose) { 558 Map matchState, bool verbose) {
559 var description = new StringDescription(); 559 var description = new StringDescription();
560 description.add('Expected ${signature} ').addDescriptionOf(matcher). 560 description.add('Expected ${signature} ').addDescriptionOf(matcher).
561 add('\n but: '); 561 add('\n but: ');
562 matcher.describeMismatch(actual, description, matchState, verbose).add('.'); 562 matcher.describeMismatch(actual, description, matchState, verbose).add('.');
563 return description.toString(); 563 return description.toString();
564 } 564 }
OLDNEW
« no previous file with comments | « pkg/mock/lib/src/behavior.dart ('k') | pkg/mock/lib/src/mock.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698