| 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 iterables | 8 * Returns a matcher that matches empty strings, maps or iterables |
| 9 * (including collections). | 9 * (including collections). |
| 10 */ | 10 */ |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 480 |
| 481 class _ArgumentError extends TypeMatcher { | 481 class _ArgumentError extends TypeMatcher { |
| 482 const _ArgumentError() : super("ArgumentError"); | 482 const _ArgumentError() : super("ArgumentError"); |
| 483 bool matches(item, MatchState matchState) => item is ArgumentError; | 483 bool matches(item, MatchState matchState) => item is ArgumentError; |
| 484 } | 484 } |
| 485 | 485 |
| 486 /** A matcher for IllegalJSRegExpExceptions. */ | 486 /** A matcher for IllegalJSRegExpExceptions. */ |
| 487 const isIllegalJSRegExpException = const _IllegalJSRegExpException(); | 487 const isIllegalJSRegExpException = const _IllegalJSRegExpException(); |
| 488 | 488 |
| 489 /** A matcher for functions that throw IllegalJSRegExpException. */ | 489 /** A matcher for functions that throw IllegalJSRegExpException. */ |
| 490 @deprecated |
| 490 const Matcher throwsIllegalJSRegExpException = | 491 const Matcher throwsIllegalJSRegExpException = |
| 491 const Throws(isIllegalJSRegExpException); | 492 const Throws(isIllegalJSRegExpException); |
| 492 | 493 |
| 493 class _IllegalJSRegExpException extends TypeMatcher { | 494 class _IllegalJSRegExpException extends TypeMatcher { |
| 494 const _IllegalJSRegExpException() : super("IllegalJSRegExpException"); | 495 const _IllegalJSRegExpException() : super("IllegalJSRegExpException"); |
| 495 bool matches(item, MatchState matchState) => item is IllegalJSRegExpException; | 496 bool matches(item, MatchState matchState) => item is IllegalJSRegExpException; |
| 496 } | 497 } |
| 497 | 498 |
| 498 /** A matcher for RangeErrors. */ | 499 /** A matcher for RangeErrors. */ |
| 499 const isRangeError = const _RangeError(); | 500 const isRangeError = const _RangeError(); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher); | 736 description.add(_featureDescription).add(' ').addDescriptionOf(_matcher); |
| 736 | 737 |
| 737 Description describeMismatch(item, Description mismatchDescription, | 738 Description describeMismatch(item, Description mismatchDescription, |
| 738 MatchState matchState, bool verbose) { | 739 MatchState matchState, bool verbose) { |
| 739 mismatchDescription.add(_featureName).add(' '); | 740 mismatchDescription.add(_featureName).add(' '); |
| 740 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription, | 741 _matcher.describeMismatch(matchState.state['feature'], mismatchDescription, |
| 741 matchState.state['innerState'], verbose); | 742 matchState.state['innerState'], verbose); |
| 742 return mismatchDescription; | 743 return mismatchDescription; |
| 743 } | 744 } |
| 744 } | 745 } |
| OLD | NEW |