| OLD | NEW |
| 1 library java.junit; | 1 library java.junit; |
| 2 | 2 |
| 3 import 'package:unittest/unittest.dart' hide fail; | 3 import 'package:unittest/unittest.dart' hide fail; |
| 4 import 'package:unittest/unittest.dart' as _ut show fail; | 4 import 'package:unittest/unittest.dart' as _ut show fail; |
| 5 | 5 |
| 6 | 6 |
| 7 class JUnitTestCase { | 7 class JUnitTestCase { |
| 8 void setUp() {} | 8 void setUp() {} |
| 9 void tearDown() {} | 9 void tearDown() {} |
| 10 static void fail(String msg) { | 10 static void fail(String msg) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 runJUnitTest(testInstance, Function testFunction) { | 45 runJUnitTest(testInstance, Function testFunction) { |
| 46 testInstance.setUp(); | 46 testInstance.setUp(); |
| 47 try { | 47 try { |
| 48 testFunction(); | 48 testFunction(); |
| 49 } finally { | 49 } finally { |
| 50 testInstance.tearDown(); | 50 testInstance.tearDown(); |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * Returns a matches that matches if the value is not the same instance | 55 * Returns a matches that matches if the value is not the same instance as "obje
ct" (`!==`). |
| 56 * as [object] (`!==`). | |
| 57 */ | 56 */ |
| 58 Matcher notSame(expected) => new _IsNotSameAs(expected); | 57 Matcher notSame(expected) => new _IsNotSameAs(expected); |
| 59 | 58 |
| 60 class _IsNotSameAs extends BaseMatcher { | 59 class _IsNotSameAs extends BaseMatcher { |
| 61 final _expected; | 60 final _expected; |
| 62 const _IsNotSameAs(this._expected); | 61 const _IsNotSameAs(this._expected); |
| 63 bool matches(item, MatchState matchState) => !identical(item, _expected); | 62 bool matches(item, MatchState matchState) => !identical(item, _expected); |
| 64 Description describe(Description description) => | 63 Description describe(Description description) => |
| 65 description.add('not same instance as ').addDescriptionOf(_expected); | 64 description.add('not same instance as ').addDescriptionOf(_expected); |
| 66 } | 65 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 return item != null; | 121 return item != null; |
| 123 } | 122 } |
| 124 Description describe(Description mismatchDescription) { | 123 Description describe(Description mismatchDescription) { |
| 125 return mismatchDescription.replace(msg); | 124 return mismatchDescription.replace(msg); |
| 126 } | 125 } |
| 127 Description describeMismatch(item, Description mismatchDescription, | 126 Description describeMismatch(item, Description mismatchDescription, |
| 128 MatchState matchState, bool verbose) { | 127 MatchState matchState, bool verbose) { |
| 129 return mismatchDescription.replace(msg).add(" $item is null"); | 128 return mismatchDescription.replace(msg).add(" $item is null"); |
| 130 } | 129 } |
| 131 } | 130 } |
| OLD | NEW |