| 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 'package:unittest/unittest.dart'; | 6 import 'package:unittest/unittest.dart'; |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 part 'test_utils.dart'; | 9 part 'test_utils.dart'; |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 description.add('a string starting with '). | 23 description.add('a string starting with '). |
| 24 addDescriptionOf(collapseWhitespace(_prefix)). | 24 addDescriptionOf(collapseWhitespace(_prefix)). |
| 25 add(' ignoring whitespace'); | 25 add(' ignoring whitespace'); |
| 26 } | 26 } |
| 27 | 27 |
| 28 class Widget { | 28 class Widget { |
| 29 int price; | 29 int price; |
| 30 } | 30 } |
| 31 | 31 |
| 32 class HasPrice extends CustomMatcher { | 32 class HasPrice extends CustomMatcher { |
| 33 const HasPrice(matcher) : | 33 HasPrice(matcher) : |
| 34 super("Widget with a price that is", "price", matcher); | 34 super("Widget with a price that is", "price", matcher); |
| 35 featureValueOf(actual) => actual.price; | 35 featureValueOf(actual) => actual.price; |
| 36 } | 36 } |
| 37 | 37 |
| 38 class SimpleIterable extends IterableBase { | 38 class SimpleIterable extends IterableBase { |
| 39 int count; | 39 int count; |
| 40 SimpleIterable(this.count); | 40 SimpleIterable(this.count); |
| 41 | 41 |
| 42 bool contains(int val) => count < val ? false : true; | 42 bool contains(int val) => count < val ? false : true; |
| 43 | 43 |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 w.price = 10; | 709 w.price = 10; |
| 710 shouldPass(w, new HasPrice(10)); | 710 shouldPass(w, new HasPrice(10)); |
| 711 shouldPass(w, new HasPrice(greaterThan(0))); | 711 shouldPass(w, new HasPrice(greaterThan(0))); |
| 712 shouldFail(w, new HasPrice(greaterThan(10)), | 712 shouldFail(w, new HasPrice(greaterThan(10)), |
| 713 'Expected: Widget with a price that is a value greater than <10> ' | 713 'Expected: Widget with a price that is a value greater than <10> ' |
| 714 'but: price was <10>.'); | 714 'but: price was <10>.'); |
| 715 }); | 715 }); |
| 716 }); | 716 }); |
| 717 } | 717 } |
| 718 | 718 |
| OLD | NEW |