Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Side by Side Diff: pkg/unittest/test/matchers_test.dart

Issue 14336015: TBR: Removed const from CustomMatcher constructor. dartc doesn't like it. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/lib/src/core_matchers.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « pkg/unittest/lib/src/core_matchers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698