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

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

Issue 12086062: Rename mappedBy to map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Undo change to test-script. Created 7 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 | « tests/corelib/list_test.dart ('k') | tests/corelib/reg_exp_all_matches_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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 queue.test; 5 library queue.test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 class QueueTest { 9 class QueueTest {
10 10
(...skipping 25 matching lines...) Expand all
36 checkQueue(queue, 3, 1110); 36 checkQueue(queue, 3, 1110);
37 37
38 int mapTest(int value) { 38 int mapTest(int value) {
39 return value ~/ 10; 39 return value ~/ 10;
40 } 40 }
41 41
42 bool is10(int value) { 42 bool is10(int value) {
43 return (value == 10); 43 return (value == 10);
44 } 44 }
45 45
46 Queue mapped = new Queue.from(queue.mappedBy(mapTest)); 46 Queue mapped = new Queue.from(queue.map(mapTest));
47 checkQueue(mapped, 3, 111); 47 checkQueue(mapped, 3, 111);
48 checkQueue(queue, 3, 1110); 48 checkQueue(queue, 3, 1110);
49 Expect.equals(1, mapped.removeFirst()); 49 Expect.equals(1, mapped.removeFirst());
50 Expect.equals(100, mapped.removeLast()); 50 Expect.equals(100, mapped.removeLast());
51 Expect.equals(10, mapped.removeFirst()); 51 Expect.equals(10, mapped.removeFirst());
52 52
53 Queue other = new Queue.from(queue.where(is10)); 53 Queue other = new Queue.from(queue.where(is10));
54 checkQueue(other, 1, 10); 54 checkQueue(other, 1, 10);
55 55
56 Expect.equals(true, queue.any(is10)); 56 Expect.equals(true, queue.any(is10));
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 entry1 = entry1.nextEntry(); 179 entry1 = entry1.nextEntry();
180 entry2 = entry2.nextEntry(); 180 entry2 = entry2.nextEntry();
181 } 181 }
182 Expect.equals(null, entry2); 182 Expect.equals(null, entry2);
183 } 183 }
184 } 184 }
185 185
186 main() { 186 main() {
187 QueueTest.testMain(); 187 QueueTest.testMain();
188 } 188 }
OLDNEW
« no previous file with comments | « tests/corelib/list_test.dart ('k') | tests/corelib/reg_exp_all_matches_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698