| 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 // This file is for matcher tests that rely on the names of various Dart types. | 5 // This file is for matcher tests that rely on the names of various Dart types. |
| 6 // These tests will fail when run in minified dart2js, since the names will be | 6 // These tests will fail when run in minified dart2js, since the names will be |
| 7 // mangled. A version of this file that works in minified dart2js is in | 7 // mangled. A version of this file that works in minified dart2js is in |
| 8 // matchers_minified_test.dart. | 8 // matchers_minified_test.dart. |
| 9 | 9 |
| 10 import 'package:unittest/unittest.dart'; | 10 import 'package:unittest/unittest.dart'; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 throwsRangeError); | 44 throwsRangeError); |
| 45 shouldFail(() { throw new Exception(); }, | 45 shouldFail(() { throw new Exception(); }, |
| 46 throwsRangeError, | 46 throwsRangeError, |
| 47 matches( | 47 matches( |
| 48 r"Expected: throws RangeError +" | 48 r"Expected: throws RangeError +" |
| 49 r"Actual: <Closure(: \(\) => dynamic)?> +" | 49 r"Actual: <Closure(: \(\) => dynamic)?> +" |
| 50 r"Which: threw \?:<Exception>")); | 50 r"Which: threw \?:<Exception>")); |
| 51 }); | 51 }); |
| 52 | 52 |
| 53 test('throwsNoSuchMethodError', () { | 53 test('throwsNoSuchMethodError', () { |
| 54 shouldPass(() { throw new NoSuchMethodError(null, '', null, null); }, | 54 shouldPass(() { |
| 55 throwsNoSuchMethodError); | 55 throw new NoSuchMethodError(null, const Symbol(''), null, null); |
| 56 }, throwsNoSuchMethodError); |
| 56 shouldFail(() { throw new Exception(); }, | 57 shouldFail(() { throw new Exception(); }, |
| 57 throwsNoSuchMethodError, | 58 throwsNoSuchMethodError, |
| 58 matches( | 59 matches( |
| 59 r"Expected: throws NoSuchMethodError +" | 60 r"Expected: throws NoSuchMethodError +" |
| 60 r"Actual: <Closure(: \(\) => dynamic)?> +" | 61 r"Actual: <Closure(: \(\) => dynamic)?> +" |
| 61 r"Which: threw \?:<Exception>")); | 62 r"Which: threw \?:<Exception>")); |
| 62 }); | 63 }); |
| 63 | 64 |
| 64 test('throwsUnimplementedError', () { | 65 test('throwsUnimplementedError', () { |
| 65 shouldPass(() { throw new UnimplementedError(''); }, | 66 shouldPass(() { throw new UnimplementedError(''); }, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 shouldPass(w, new HasPrice(10)); | 121 shouldPass(w, new HasPrice(10)); |
| 121 shouldPass(w, new HasPrice(greaterThan(0))); | 122 shouldPass(w, new HasPrice(greaterThan(0))); |
| 122 shouldFail(w, new HasPrice(greaterThan(10)), | 123 shouldFail(w, new HasPrice(greaterThan(10)), |
| 123 "Expected: Widget with a price that is a value greater than <10> " | 124 "Expected: Widget with a price that is a value greater than <10> " |
| 124 "Actual: <Instance of 'Widget'> " | 125 "Actual: <Instance of 'Widget'> " |
| 125 "Which: has price with value <10> which is not " | 126 "Which: has price with value <10> which is not " |
| 126 "a value greater than <10>"); | 127 "a value greater than <10>"); |
| 127 }); | 128 }); |
| 128 }); | 129 }); |
| 129 } | 130 } |
| OLD | NEW |