| OLD | NEW |
| 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 algorithm utilities. | 5 /// Tests algorithm utilities. |
| 6 | 6 |
| 7 import "package:collection/collection.dart"; | 7 import "package:collection/collection.dart"; |
| 8 import "package:unittest/unittest.dart"; | 8 import "package:test/test.dart"; |
| 9 import 'dart:math'; | 9 import 'dart:math'; |
| 10 | 10 |
| 11 void main() { | 11 void main() { |
| 12 void testShuffle(List list) { | 12 void testShuffle(List list) { |
| 13 List copy = list.toList(); | 13 List copy = list.toList(); |
| 14 shuffle(list); | 14 shuffle(list); |
| 15 expect(new UnorderedIterableEquality().equals(list, copy), isTrue); | 15 expect(new UnorderedIterableEquality().equals(list, copy), isTrue); |
| 16 } | 16 } |
| 17 | 17 |
| 18 test("Shuffle 0", () { | 18 test("Shuffle 0", () { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 262 } |
| 263 int compareC(C one, C other) => one.id - other.id; | 263 int compareC(C one, C other) => one.id - other.id; |
| 264 | 264 |
| 265 class OC implements Comparable<OC> { | 265 class OC implements Comparable<OC> { |
| 266 final int id; | 266 final int id; |
| 267 final int order; | 267 final int order; |
| 268 OC(this.id, this.order); | 268 OC(this.id, this.order); |
| 269 int compareTo(OC other) => id - other.id; | 269 int compareTo(OC other) => id - other.id; |
| 270 String toString() => "OC[$id,$order]"; | 270 String toString() => "OC[$id,$order]"; |
| 271 } | 271 } |
| OLD | NEW |