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 library matcher.numeric_matchers_test; | 5 library matcher.numeric_matchers_test; |
6 | 6 |
7 import 'package:matcher/matcher.dart'; | 7 import 'package:matcher/matcher.dart'; |
8 import 'package:unittest/unittest.dart' show test, group; | 8 import 'package:unittest/unittest.dart' show test, group; |
9 | 9 |
10 import 'test_utils.dart'; | 10 import 'test_utils.dart'; |
11 | 11 |
12 void main() { | 12 void main() { |
13 initUtils(); | |
14 | |
15 test('greaterThan', () { | 13 test('greaterThan', () { |
16 shouldPass(10, greaterThan(9)); | 14 shouldPass(10, greaterThan(9)); |
17 shouldFail(9, greaterThan(10), "Expected: a value greater than <10> " | 15 shouldFail(9, greaterThan(10), "Expected: a value greater than <10> " |
18 "Actual: <9> " | 16 "Actual: <9> " |
19 "Which: is not a value greater than <10>"); | 17 "Which: is not a value greater than <10>"); |
20 }); | 18 }); |
21 | 19 |
22 test('greaterThanOrEqualTo', () { | 20 test('greaterThanOrEqualTo', () { |
23 shouldPass(10, greaterThanOrEqualTo(10)); | 21 shouldPass(10, greaterThanOrEqualTo(10)); |
24 shouldFail(9, greaterThanOrEqualTo(10), | 22 shouldFail(9, greaterThanOrEqualTo(10), |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 }); | 132 }); |
135 | 133 |
136 test('inClosedOpenRange', () { | 134 test('inClosedOpenRange', () { |
137 shouldPass(0, inClosedOpenRange(0, 2)); | 135 shouldPass(0, inClosedOpenRange(0, 2)); |
138 shouldPass(1, inClosedOpenRange(0, 2)); | 136 shouldPass(1, inClosedOpenRange(0, 2)); |
139 shouldFail(2, inClosedOpenRange(0, 2), | 137 shouldFail(2, inClosedOpenRange(0, 2), |
140 "Expected: be in range from 0 (inclusive) to 2 (exclusive) " | 138 "Expected: be in range from 0 (inclusive) to 2 (exclusive) " |
141 "Actual: <2>"); | 139 "Actual: <2>"); |
142 }); | 140 }); |
143 } | 141 } |
OLD | NEW |