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

Side by Side Diff: pkg/unittest/map_matchers.dart

Issue 11275054: Modified unittest to use new argument syntax. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
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 /** 5 /**
6 * Returns a matcher which matches maps containing the given [value]. 6 * Returns a matcher which matches maps containing the given [value].
7 */ 7 */
8
9 part of unittest;
10
8 Matcher containsValue(value) => new _ContainsValue(value); 11 Matcher containsValue(value) => new _ContainsValue(value);
9 12
10 class _ContainsValue extends BaseMatcher { 13 class _ContainsValue extends BaseMatcher {
11 final _value; 14 final _value;
12 15
13 const _ContainsValue(this._value); 16 const _ContainsValue(this._value);
14 17
15 bool matches(item, MatchState matchState) => item.containsValue(_value); 18 bool matches(item, MatchState matchState) => item.containsValue(_value);
16 Description describe(Description description) => 19 Description describe(Description description) =>
17 description.add('contains value ').addDescriptionOf(_value); 20 description.add('contains value ').addDescriptionOf(_value);
(...skipping 28 matching lines...) Expand all
46 add(" doesn't contain key ").addDescriptionOf(_key); 49 add(" doesn't contain key ").addDescriptionOf(_key);
47 } else { 50 } else {
48 mismatchDescription.add(' contains key ').addDescriptionOf(_key). 51 mismatchDescription.add(' contains key ').addDescriptionOf(_key).
49 add(' but with value '); 52 add(' but with value ');
50 _valueMatcher.describeMismatch(item[_key], mismatchDescription, 53 _valueMatcher.describeMismatch(item[_key], mismatchDescription,
51 matchState, verbose); 54 matchState, verbose);
52 return mismatchDescription; 55 return mismatchDescription;
53 } 56 }
54 } 57 }
55 } 58 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698