Chromium Code Reviews| 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(NaN, isNaN); | |
|
kevmoo
2014/07/22 20:44:37
you need double.NAN here, right?
srawlins
2014/07/22 22:49:06
Done.
| |
| 38 shouldFail(3.1, isNaN, "Expected: NaN Actual: <3.1>"); | |
| 39 }); | |
| 40 | |
| 41 test('isNotNaN', () { | |
| 42 shouldPass(3.1, isNotNaN); | |
| 43 shouldFail(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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 }); | 212 }); |
| 203 } | 213 } |
| 204 | 214 |
| 205 class _Bicycle { | 215 class _Bicycle { |
| 206 static final foo = bar(); | 216 static final foo = bar(); |
| 207 | 217 |
| 208 static bar() { | 218 static bar() { |
| 209 return foo + 1; | 219 return foo + 1; |
| 210 } | 220 } |
| 211 } | 221 } |
| OLD | NEW |