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 /** | 5 /** |
6 * Returns a matcher which matches if the match argument is greater | 6 * Returns a matcher which matches if the match argument is greater |
7 * than the given [value]. | 7 * than the given [value]. |
8 */ | 8 */ |
9 Matcher greaterThan(value) => | 9 Matcher greaterThan(value) => |
10 new _OrderingComparison(value, false, false, true, 'a value greater than'); | 10 new _OrderingComparison(value, false, false, true, 'a value greater than'); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 final String _comparisonDescription; | 88 final String _comparisonDescription; |
89 /** Whether to include the expected value in the description */ | 89 /** Whether to include the expected value in the description */ |
90 final bool _valueInDescription; | 90 final bool _valueInDescription; |
91 | 91 |
92 const _OrderingComparison( | 92 const _OrderingComparison( |
93 this._value, | 93 this._value, |
94 this._equalValue, | 94 this._equalValue, |
95 this._lessThanValue, | 95 this._lessThanValue, |
96 this._greaterThanValue, | 96 this._greaterThanValue, |
97 this._comparisonDescription, | 97 this._comparisonDescription, |
98 [this._valueInDescription = true]); | 98 [valueInDescription = true]) : this._valueInDescription = valueInDescription ; |
Ivan Posva
2012/06/12 10:43:05
Long line?
| |
99 | 99 |
100 bool matches(item) { | 100 bool matches(item) { |
101 if (item == _value) { | 101 if (item == _value) { |
102 return _equalValue; | 102 return _equalValue; |
103 } else if (item < _value) { | 103 } else if (item < _value) { |
104 return _lessThanValue; | 104 return _lessThanValue; |
105 } else { | 105 } else { |
106 return _greaterThanValue; | 106 return _greaterThanValue; |
107 } | 107 } |
108 } | 108 } |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 if (item is !num) { | 216 if (item is !num) { |
217 return mismatchDescription. | 217 return mismatchDescription. |
218 addDescriptionOf(item). | 218 addDescriptionOf(item). |
219 add(' not numeric'); | 219 add(' not numeric'); |
220 } else { | 220 } else { |
221 return super.describeMismatch(item, mismatchDescription); | 221 return super.describeMismatch(item, mismatchDescription); |
222 } | 222 } |
223 } | 223 } |
224 } | 224 } |
225 | 225 |
OLD | NEW |