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

Side by Side Diff: tests/corelib/iterable_length_test.dart

Issue 14022007: Move Iterable implementation to collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Merge to head. 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 | « tests/compiler/dart2js_extra/for_in_test.dart ('k') | tests/language/factory2_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 import "dart:collection";
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 class A extends Iterable { 8 class A extends IterableBase {
8 int count; 9 int count;
9 A(this.count); 10 A(this.count);
10 11
11 Iterator get iterator { 12 Iterator get iterator {
12 return new AIterator(count); 13 return new AIterator(count);
13 } 14 }
14 } 15 }
15 16
16 class AIterator implements Iterator { 17 class AIterator implements Iterator {
17 int _count; 18 int _count;
(...skipping 16 matching lines...) Expand all
34 35
35 main() { 36 main() {
36 var a = new A(10); 37 var a = new A(10);
37 Expect.equals(10, a.length); 38 Expect.equals(10, a.length);
38 a = new A(0); 39 a = new A(0);
39 Expect.equals(0, a.length); 40 Expect.equals(0, a.length);
40 a = new A(5); 41 a = new A(5);
41 Expect.equals(5, a.map((e) => e + 1).length); 42 Expect.equals(5, a.map((e) => e + 1).length);
42 Expect.equals(3, a.where((e) => e >= 3).length); 43 Expect.equals(3, a.where((e) => e >= 3).length);
43 } 44 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/for_in_test.dart ('k') | tests/language/factory2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698