| 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 unittestTests; | 5 library unittestTests; |
| 6 import '../../../pkg/unittest/lib/unittest.dart'; | 6 import '../../../pkg/unittest/lib/unittest.dart'; |
| 7 part 'test_utils.dart'; | 7 part 'test_utils.dart'; |
| 8 | 8 |
| 9 doesNotThrow() {} | 9 doesNotThrow() {} |
| 10 doesThrow() { throw 'X'; } | 10 doesThrow() { throw 'X'; } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 group('Core matchers', () { | 42 group('Core matchers', () { |
| 43 | 43 |
| 44 test('isTrue', () { | 44 test('isTrue', () { |
| 45 shouldPass(true, isTrue); | 45 shouldPass(true, isTrue); |
| 46 shouldFail(false, isTrue, "Expected: true but: was <false>."); | 46 shouldFail(false, isTrue, "Expected: true but: was <false>."); |
| 47 }); | 47 }); |
| 48 | 48 |
| 49 test('isFalse', () { | 49 test('isFalse', () { |
| 50 shouldPass(false, isFalse); | 50 shouldPass(false, isFalse); |
| 51 shouldFail(10, isFalse, "Expected: false but: was <10>."); |
| 51 shouldFail(true, isFalse, "Expected: false but: was <true>."); | 52 shouldFail(true, isFalse, "Expected: false but: was <true>."); |
| 52 }); | 53 }); |
| 53 | 54 |
| 54 test('isNull', () { | 55 test('isNull', () { |
| 55 shouldPass(null, isNull); | 56 shouldPass(null, isNull); |
| 56 shouldFail(false, isNull, "Expected: null but: was <false>."); | 57 shouldFail(false, isNull, "Expected: null but: was <false>."); |
| 57 }); | 58 }); |
| 58 | 59 |
| 59 test('isNotNull', () { | 60 test('isNotNull', () { |
| 60 shouldPass(false, isNotNull); | 61 shouldPass(false, isNotNull); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 var w = new Widget(); | 537 var w = new Widget(); |
| 537 w.price = 10; | 538 w.price = 10; |
| 538 shouldPass(w, new HasPrice(greaterThan(0))); | 539 shouldPass(w, new HasPrice(greaterThan(0))); |
| 539 shouldFail(w, new HasPrice(greaterThan(10)), | 540 shouldFail(w, new HasPrice(greaterThan(10)), |
| 540 'Expected: Widget with a price that is a value greater than <10> ' | 541 'Expected: Widget with a price that is a value greater than <10> ' |
| 541 'but: price was <10>.'); | 542 'but: price was <10>.'); |
| 542 }); | 543 }); |
| 543 }); | 544 }); |
| 544 } | 545 } |
| 545 | 546 |
| OLD | NEW |