OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 enumset.test; | 5 library enumset.test; |
6 | 6 |
7 import 'package:compiler/src/util/enumset.dart'; | 7 import 'package:compiler/src/util/enumset.dart'; |
8 import 'package:expect/expect.dart'; | 8 import 'package:expect/expect.dart'; |
9 | 9 |
10 enum Enum { A, B, C, D, E, F, } | 10 enum Enum { |
| 11 A, |
| 12 B, |
| 13 C, |
| 14 D, |
| 15 E, |
| 16 F, |
| 17 } |
11 | 18 |
12 main() { | 19 main() { |
13 testAddRemoveContains(); | 20 testAddRemoveContains(); |
14 testConstructorsIntersects(); | 21 testConstructorsIntersects(); |
15 } | 22 } |
16 | 23 |
17 void checkEnumSet(EnumSet<Enum> enumSet, int expectedValue, | 24 void checkEnumSet(EnumSet<Enum> enumSet, int expectedValue, |
18 List<Enum> expectedValues, String expectedToString) { | 25 List<Enum> expectedValues, String expectedToString) { |
19 Expect.equals(expectedValue, enumSet.value, | 26 Expect.equals(expectedValue, enumSet.value, |
20 "Unexpected EnumSet.value for ${enumSet.iterable(Enum.values)}"); | 27 "Unexpected EnumSet.value for ${enumSet.iterable(Enum.values)}"); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 144 |
138 checkIntersects(emptyA, singleA, false); | 145 checkIntersects(emptyA, singleA, false); |
139 checkIntersects(emptyA, multiA, false); | 146 checkIntersects(emptyA, multiA, false); |
140 checkIntersects(emptyA, multi2, false); | 147 checkIntersects(emptyA, multi2, false); |
141 | 148 |
142 checkIntersects(singleA, multiA, false); | 149 checkIntersects(singleA, multiA, false); |
143 checkIntersects(singleA, multi2, true); | 150 checkIntersects(singleA, multi2, true); |
144 | 151 |
145 checkIntersects(multiA, multi2, true); | 152 checkIntersects(multiA, multi2, true); |
146 } | 153 } |
OLD | NEW |