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

Side by Side Diff: pkg/collection/test/priority_queue_test.dart

Issue 182153002: pkg/collection: fix version (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/collection/pubspec.yaml ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /// Tests priority queue implementations utilities. 5 /// Tests priority queue implementations utilities.
6 6
7 import "dart:collection";
8 import "package:collection/priority_queue.dart"; 7 import "package:collection/priority_queue.dart";
9 import "package:unittest/unittest.dart"; 8 import "package:unittest/unittest.dart";
10 9
11 void main() { 10 void main() {
12 testInt(() => new HeapPriorityQueue<int>()); 11 testInt(() => new HeapPriorityQueue<int>());
13 testCustom((comparator) => new HeapPriorityQueue<C>(comparator)); 12 testCustom((comparator) => new HeapPriorityQueue<C>(comparator));
14 } 13 }
15 14
16 void testInt(PriorityQueue<int> create()) { 15 void testInt(PriorityQueue<int> create()) {
17 for (int count in [1, 5, 127, 128]) { 16 for (int count in [1, 5, 127, 128]) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 int compareNeg(C c1, C c2) => c2.value - c1.value; 157 int compareNeg(C c1, C c2) => c2.value - c1.value;
159 158
160 class C implements Comparable { 159 class C implements Comparable {
161 final int value; 160 final int value;
162 const C(this.value); 161 const C(this.value);
163 int get hashCode => value; 162 int get hashCode => value;
164 bool operator==(Object other) => other is C && value == other.value; 163 bool operator==(Object other) => other is C && value == other.value;
165 int compareTo(C other) => value - other.value; 164 int compareTo(C other) => value - other.value;
166 String toString() => "C($value)"; 165 String toString() => "C($value)";
167 } 166 }
OLDNEW
« no previous file with comments | « pkg/collection/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698