OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 library stream_min_max_test; | 5 library stream_min_max_test; |
6 | 6 |
7 import "package:expect/expect.dart"; | |
8 import 'dart:async'; | 7 import 'dart:async'; |
9 import 'dart:isolate'; | 8 import 'dart:isolate'; |
10 import '../../../pkg/unittest/lib/unittest.dart'; | 9 import '../../../pkg/unittest/lib/unittest.dart'; |
11 import 'event_helper.dart'; | 10 import 'event_helper.dart'; |
12 | 11 |
13 const int big = 1000000; | 12 const int big = 1000000; |
14 const double inf = double.INFINITY; | 13 const double inf = double.INFINITY; |
15 List intList = const [-0, 0, -1, 1, -10, 10, -big, big]; | 14 List intList = const [-0, 0, -1, 1, -10, 10, -big, big]; |
16 List doubleList = const [-0.0, 0.0, -1.0, 1.0, -10.0, 10.0, -inf, inf]; | 15 List doubleList = const [-0.0, 0.0, -1.0, 1.0, -10.0, 10.0, -inf, inf]; |
17 | 16 |
(...skipping 18 matching lines...) Expand all Loading... |
36 testMinMax("set-int", intList.toSet(), -big, big); | 35 testMinMax("set-int", intList.toSet(), -big, big); |
37 | 36 |
38 testMinMax("const-double", doubleList, -inf, inf); | 37 testMinMax("const-double", doubleList, -inf, inf); |
39 testMinMax("list-double", doubleList.toList(), -inf, inf); | 38 testMinMax("list-double", doubleList.toList(), -inf, inf); |
40 testMinMax("set-double", doubleList.toSet(), -inf, inf); | 39 testMinMax("set-double", doubleList.toSet(), -inf, inf); |
41 | 40 |
42 int reverse(a, b) => b.compareTo(a); | 41 int reverse(a, b) => b.compareTo(a); |
43 testMinMax("rev-int", intList, big, -big, reverse); | 42 testMinMax("rev-int", intList, big, -big, reverse); |
44 testMinMax("rev-double", doubleList, inf, -inf, reverse); | 43 testMinMax("rev-double", doubleList, inf, -inf, reverse); |
45 } | 44 } |
OLD | NEW |