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

Unified Diff: tests/corelib/src/QueueTest.dart

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: tests/corelib/src/QueueTest.dart
===================================================================
--- tests/corelib/src/QueueTest.dart (revision 2973)
+++ tests/corelib/src/QueueTest.dart (working copy)
@@ -34,10 +34,21 @@
queue.removeFirst();
checkQueue(queue, 3, 1110);
- bool is10(int value) {
+ int mapTest(int value) {
+ return value~/10;
ahe 2012/01/05 22:36:54 Spaces around operator.
+ }
+
+ bool is10(int value) {
ahe 2012/01/05 22:36:54 Remove trailing whitespace.
return (value == 10);
}
+ Queue mapped = queue.map(mapTest);
+ checkQueue(mapped, 3, 111);
+ checkQueue(queue, 3, 1110);
+ Expect.equals(1, mapped.removeFirst());
+ Expect.equals(100, mapped.removeLast());
+ Expect.equals(10, mapped.removeFirst());
+
Queue other = queue.filter(is10);
checkQueue(other, 1, 10);
@@ -155,8 +166,8 @@
}
static testQueueElements() {
- Queue<int> queue1 = new DoubleLinkedQueue<int>.from([1, 2, 4]);
- Queue<int> queue2 = new DoubleLinkedQueue<int>();
+ DoubleLinkedQueue<int> queue1 = new DoubleLinkedQueue<int>.from([1, 2, 4]);
+ DoubleLinkedQueue<int> queue2 = new DoubleLinkedQueue<int>();
queue2.addAll(queue1);
Expect.equals(queue1.length, queue2.length);

Powered by Google App Engine
This is Rietveld 408576698