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

Side by Side Diff: pkg/unittest/lib/src/core_matchers.dart

Issue 11368151: Change isFalse to test against false instead of against true. (Issue 6611). (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
« no previous file with comments | « no previous file | pkg/unittest/test/matchers_test.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 part of matcher; 5 part of matcher;
6 6
7 /** 7 /**
8 * Returns a matcher that matches empty strings, maps or collections. 8 * Returns a matcher that matches empty strings, maps or collections.
9 */ 9 */
10 const Matcher isEmpty = const _Empty(); 10 const Matcher isEmpty = const _Empty();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 class _IsTrue extends BaseMatcher { 53 class _IsTrue extends BaseMatcher {
54 const _IsTrue(); 54 const _IsTrue();
55 bool matches(item, MatchState matchState) => item == true; 55 bool matches(item, MatchState matchState) => item == true;
56 Description describe(Description description) => 56 Description describe(Description description) =>
57 description.add('true'); 57 description.add('true');
58 } 58 }
59 59
60 class _IsFalse extends BaseMatcher { 60 class _IsFalse extends BaseMatcher {
61 const _IsFalse(); 61 const _IsFalse();
62 bool matches(item, MatchState matchState) => item != true; 62 bool matches(item, MatchState matchState) => item == false;
63 Description describe(Description description) => 63 Description describe(Description description) =>
64 description.add('false'); 64 description.add('false');
65 } 65 }
66 66
67 /** 67 /**
68 * Returns a matches that matches if the value is the same instance 68 * Returns a matches that matches if the value is the same instance
69 * as [object] (`===`). 69 * as [object] (`===`).
70 */ 70 */
71 Matcher same(expected) => new _IsSameAs(expected); 71 Matcher same(expected) => new _IsSameAs(expected);
72 72
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher); 711 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher);
712 712
713 Description describeMismatch(item, Description mismatchDescription, 713 Description describeMismatch(item, Description mismatchDescription,
714 MatchState matchState, bool verbose) { 714 MatchState matchState, bool verbose) {
715 mismatchDescription.add(_featureName).add(' '); 715 mismatchDescription.add(_featureName).add(' ');
716 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription, 716 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription,
717 matchState.state['innerState'], verbose); 717 matchState.state['innerState'], verbose);
718 return mismatchDescription; 718 return mismatchDescription;
719 } 719 }
720 } 720 }
OLDNEW
« no previous file with comments | « no previous file | pkg/unittest/test/matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698