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

Side by Side Diff: test/priority_queue_test.dart

Issue 1213723007: Update to test package, make test work on dart2js. (Closed) Base URL: https://github.com/dart-lang/collection.git@master
Patch Set: Also update version. Created 5 years, 5 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
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 "package:collection/priority_queue.dart"; 7 import "package:collection/priority_queue.dart";
8 import "package:unittest/unittest.dart"; 8 import "package:test/test.dart";
9 9
10 void main() { 10 void main() {
11 testInt(() => new HeapPriorityQueue<int>()); 11 testInt(() => new HeapPriorityQueue<int>());
12 testCustom((comparator) => new HeapPriorityQueue<C>(comparator)); 12 testCustom((comparator) => new HeapPriorityQueue<C>(comparator));
13 } 13 }
14 14
15 void testInt(PriorityQueue<int> create()) { 15 void testInt(PriorityQueue<int> create()) {
16 for (int count in [1, 5, 127, 128]) { 16 for (int count in [1, 5, 127, 128]) {
17 testQueue("int:$count", 17 testQueue("int:$count",
18 create, 18 create,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 int compareNeg(C c1, C c2) => c2.value - c1.value; 157 int compareNeg(C c1, C c2) => c2.value - c1.value;
158 158
159 class C implements Comparable { 159 class C implements Comparable {
160 final int value; 160 final int value;
161 const C(this.value); 161 const C(this.value);
162 int get hashCode => value; 162 int get hashCode => value;
163 bool operator==(Object other) => other is C && value == other.value; 163 bool operator==(Object other) => other is C && value == other.value;
164 int compareTo(C other) => value - other.value; 164 int compareTo(C other) => value - other.value;
165 String toString() => "C($value)"; 165 String toString() => "C($value)";
166 } 166 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698