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

Unified Diff: tests/corelib_strong/sort_test.dart

Issue 2683583009: Fix corelib_strong/sort_test on dev_compiler (Closed)
Patch Set: Add status file change Created 3 years, 10 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
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..72e11a49ff1d2817b01cb3bc914d6fe2adea83ce 100644
--- a/tests/corelib_strong/sort_test.dart
+++ b/tests/corelib_strong/sort_test.dart
@@ -7,24 +7,22 @@ library sort_test;
import "package:expect/expect.dart";
import 'sort_helper.dart';
-typedef int intPairToInt(int a, int b);
-
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 +30,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 +41,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]);
« no previous file with comments | « pkg/dev_compiler/test/browser/language_tests.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698