Chromium Code Reviews| Index: tests/corelib_strong/sort_test.dart |
| diff --git a/tests/corelib_strong/sort_test.dart b/tests/corelib_strong/sort_test.dart |
| index 99a0c71d1389e59026746e5a4c1858916f27b5f5..1f77d41210618605e3857a55741c2887c84695c4 100644 |
| --- a/tests/corelib_strong/sort_test.dart |
| +++ b/tests/corelib_strong/sort_test.dart |
| @@ -10,21 +10,21 @@ import 'sort_helper.dart'; |
| typedef int intPairToInt(int a, int b); |
|
vsm
2017/02/08 22:00:02
drop the typedef?
Bill Hesse
2017/02/08 22:08:18
Good catch!
|
| main() { |
| - intPairToInt compare = (a, b) => a.compareTo(b); |
| + var compare = (a, b) => a.compareTo(b); |
| var sort = (list) => list.sort(compare); |
| new SortHelper(sort, compare).run(); |
| compare = (a, b) => -a.compareTo(b); |
| new SortHelper(sort, compare).run(); |
| - compare = (a, b) => a.compareTo(b); |
| + var intCompare = (int a, int b) => a.compareTo(b); |
| // Pivot-canditate indices: 7, 15, 22, 29, 37 |
| // Test dutch flag partitioning (canditates 2 and 4 are the same). |
| var list = [0, 0, 0, 0, 0, 0, 0, 0/**/, 0, 0, 0, 0, 0, 0, 0, |
| 1/**/, 1, 1, 1, 1, 1, 1, 1/**/, 1, 1, 1, 1, 1, 1, 1/**/, |
| 2, 2, 2, 2, 2, 2, 2, 2/**/, 2, 2, 2, 2, 2, 2, 2]; |
| - list.sort(compare); |
| + list.sort(intCompare); |
| Expect.listEquals(list, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]); |
| @@ -32,7 +32,7 @@ main() { |
| list = [0, 0, 0, 0, 0, 0, 0, 1/**/, 0, 0, 0, 0, 0, 0, 0, |
| 0/**/, 1, 1, 1, 1, 1, 1, 0/**/, 1, 1, 1, 1, 1, 1, 0/**/, |
| 2/**/, 2, 2, 2, 2, 2, 2, 2/**/, 2, 2, 2, 2, 2, 2, 2]; |
| - list.sort(compare); |
| + list.sort(intCompare); |
| Expect.listEquals(list, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]); |
| @@ -43,7 +43,7 @@ main() { |
| list = [0, 9, 0, 9, 3, 9, 0, 1/**/, 1, 0, 1, 9, 8, 2, 1, |
| 1/**/, 4, 5, 2, 5, 0, 1, 8/**/, 8, 8, 5, 2, 2, 9, 8/**/, |
| 8, 4, 4, 1, 5, 3, 2, 8/**/, 5, 1, 2, 8, 5, 6, 8]; |
| - list.sort(compare); |
| + list.sort(intCompare); |
| Expect.listEquals(list, [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, |
| 2, 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, |
| 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9]); |