| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |