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

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

Issue 145403005: pkg/unittest: formatter spin (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review nits Created 6 years, 10 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/test/mock_test.dart ('k') | pkg/unittest/test/unittest_completion_test.dart » ('j') | 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 test_common; 5 library test_common;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
11 class Widget { 11 class Widget {
12 int price; 12 int price;
13 } 13 }
14 14
15 class HasPrice extends CustomMatcher { 15 class HasPrice extends CustomMatcher {
16 HasPrice(matcher) : 16 HasPrice(matcher) :
17 super("Widget with a price that is", "price", matcher); 17 super("Widget with a price that is", "price", matcher);
18 featureValueOf(actual) => actual.price; 18 featureValueOf(actual) => actual.price;
19 } 19 }
20 20
21 class SimpleIterable extends IterableBase { 21 class SimpleIterable extends IterableBase {
22 int count; 22 int count;
23 SimpleIterable(this.count); 23 SimpleIterable(this.count);
24 24
25 bool contains(int val) => count < val ? false : true; 25 bool contains(int val) => count < val ? false : true;
26 26
27 bool any(bool f(element)) { 27 bool any(bool f(element)) {
28 for(var i = 0; i <= count; i++) { 28 for (var i = 0; i <= count; i++) {
29 if(f(i)) return true; 29 if (f(i)) return true;
30 } 30 }
31 return false; 31 return false;
32 } 32 }
33 33
34 String toString() => "<[$count]>"; 34 String toString() => "<[$count]>";
35 35
36 Iterator get iterator { 36 Iterator get iterator {
37 return new SimpleIterator(count); 37 return new SimpleIterator(count);
38 } 38 }
39 } 39 }
(...skipping 10 matching lines...) Expand all
50 _count--; 50 _count--;
51 return true; 51 return true;
52 } 52 }
53 _current = null; 53 _current = null;
54 return false; 54 return false;
55 } 55 }
56 56
57 get current => _current; 57 get current => _current;
58 } 58 }
59 59
OLDNEW
« no previous file with comments | « pkg/unittest/test/mock_test.dart ('k') | pkg/unittest/test/unittest_completion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698