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.core_matchers_test; | 5 library matcher.core_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'; |
(...skipping 15 matching lines...) Expand all Loading... |
26 test('isNull', () { | 26 test('isNull', () { |
27 shouldPass(null, isNull); | 27 shouldPass(null, isNull); |
28 shouldFail(false, isNull, "Expected: null Actual: <false>"); | 28 shouldFail(false, isNull, "Expected: null Actual: <false>"); |
29 }); | 29 }); |
30 | 30 |
31 test('isNotNull', () { | 31 test('isNotNull', () { |
32 shouldPass(false, isNotNull); | 32 shouldPass(false, isNotNull); |
33 shouldFail(null, isNotNull, "Expected: not null Actual: <null>"); | 33 shouldFail(null, isNotNull, "Expected: not null Actual: <null>"); |
34 }); | 34 }); |
35 | 35 |
| 36 test('isNaN', () { |
| 37 shouldPass(double.NAN, isNaN); |
| 38 shouldFail(3.1, isNaN, "Expected: NaN Actual: <3.1>"); |
| 39 }); |
| 40 |
| 41 test('isNotNaN', () { |
| 42 shouldPass(3.1, isNotNaN); |
| 43 shouldFail(double.NAN, isNotNaN, "Expected: not NaN Actual: <NaN>"); |
| 44 }); |
| 45 |
36 test('same', () { | 46 test('same', () { |
37 var a = new Map(); | 47 var a = new Map(); |
38 var b = new Map(); | 48 var b = new Map(); |
39 shouldPass(a, same(a)); | 49 shouldPass(a, same(a)); |
40 shouldFail(b, same(a), "Expected: same instance as {} Actual: {}"); | 50 shouldFail(b, same(a), "Expected: same instance as {} Actual: {}"); |
41 }); | 51 }); |
42 | 52 |
43 test('equals', () { | 53 test('equals', () { |
44 var a = new Map(); | 54 var a = new Map(); |
45 var b = new Map(); | 55 var b = new Map(); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 }); | 230 }); |
221 } | 231 } |
222 | 232 |
223 class _Bicycle { | 233 class _Bicycle { |
224 static final foo = bar(); | 234 static final foo = bar(); |
225 | 235 |
226 static bar() { | 236 static bar() { |
227 return foo + 1; | 237 return foo + 1; |
228 } | 238 } |
229 } | 239 } |
OLD | NEW |