| 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 which matches if the match argument is greater | 8 * Returns a matcher which matches if the match argument is greater |
| 9 * than the given [value]. | 9 * than the given [value]. |
| 10 */ | 10 */ |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 const Matcher isNegative = | 66 const Matcher isNegative = |
| 67 const _OrderingComparison(0, false, true, false, 'a negative value', false); | 67 const _OrderingComparison(0, false, true, false, 'a negative value', false); |
| 68 | 68 |
| 69 /** | 69 /** |
| 70 * A matcher which matches if the match argument is zero or positive. | 70 * A matcher which matches if the match argument is zero or positive. |
| 71 */ | 71 */ |
| 72 const Matcher isNonNegative = | 72 const Matcher isNonNegative = |
| 73 const _OrderingComparison(0, true, false, true, | 73 const _OrderingComparison(0, true, false, true, |
| 74 'a non-negative value', false); | 74 'a non-negative value', false); |
| 75 | 75 |
| 76 bool _isNumeric(value) { | 76 bool _isNumeric(Object value) { |
| 77 return value is int || value is double; | 77 return value is num; |
| 78 } | 78 } |
| 79 | 79 |
| 80 class _OrderingComparison extends Matcher { | 80 class _OrderingComparison extends Matcher { |
| 81 /** Expected value. */ | 81 /** Expected value. */ |
| 82 final _value; | 82 final _value; |
| 83 /** What to return if actual == expected */ | 83 /** What to return if actual == expected */ |
| 84 final bool _equalValue; | 84 final bool _equalValue; |
| 85 /** What to return if actual < expected */ | 85 /** What to return if actual < expected */ |
| 86 final bool _lessThanValue; | 86 final bool _lessThanValue; |
| 87 /** What to return if actual > expected */ | 87 /** What to return if actual > expected */ |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 return mismatchDescription. | 225 return mismatchDescription. |
| 226 addDescriptionOf(item). | 226 addDescriptionOf(item). |
| 227 add(' not numeric'); | 227 add(' not numeric'); |
| 228 } else { | 228 } else { |
| 229 return super.describeMismatch(item, mismatchDescription, | 229 return super.describeMismatch(item, mismatchDescription, |
| 230 matchState, verbose); | 230 matchState, verbose); |
| 231 } | 231 } |
| 232 } | 232 } |
| 233 } | 233 } |
| 234 | 234 |
| OLD | NEW |