| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 test.enums; | 5 library test.enums; |
| 6 | 6 |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 ..check_getters() | 47 ..check_getters() |
| 48 ..check_explicit_values(); | 48 ..check_explicit_values(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void test_CacheState() { | 51 void test_CacheState() { |
| 52 new EnumTester<CacheState>() | 52 new EnumTester<CacheState>() |
| 53 ..check_getters() | 53 ..check_getters() |
| 54 ..check_explicit_values(); | 54 ..check_explicit_values(); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void test_CommentType() { | |
| 58 new EnumTester<CommentType>() | |
| 59 ..check_getters() | |
| 60 ..check_explicit_values(); | |
| 61 } | |
| 62 | |
| 63 void test_ElementKind() { | 57 void test_ElementKind() { |
| 64 new EnumTester<ElementKind>() | 58 new EnumTester<ElementKind>() |
| 65 ..check_getters() | 59 ..check_getters() |
| 66 ..check_explicit_values(); | 60 ..check_explicit_values(); |
| 67 } | 61 } |
| 68 | 62 |
| 69 void test_ErrorProperty() { | 63 void test_ErrorProperty() { |
| 70 new EnumTester<ErrorProperty>() | 64 new EnumTester<ErrorProperty>() |
| 71 ..check_getters() | 65 ..check_getters() |
| 72 ..check_explicit_values(); | 66 ..check_explicit_values(); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 ..check_getters() | 149 ..check_getters() |
| 156 ..check_explicit_values(); | 150 ..check_explicit_values(); |
| 157 } | 151 } |
| 158 | 152 |
| 159 void test_UriKind() { | 153 void test_UriKind() { |
| 160 new EnumTester<UriKind>() | 154 new EnumTester<UriKind>() |
| 161 ..check_getters() | 155 ..check_getters() |
| 162 ..check_explicit_values(); | 156 ..check_explicit_values(); |
| 163 } | 157 } |
| 164 | 158 |
| 165 void test_UriValidationCode() { | |
| 166 new EnumTester<UriValidationCode>() | |
| 167 ..check_getters() | |
| 168 ..check_explicit_values(); | |
| 169 } | |
| 170 | |
| 171 void test_WrapperKind() { | 159 void test_WrapperKind() { |
| 172 new EnumTester<WrapperKind>() | 160 new EnumTester<WrapperKind>() |
| 173 ..check_getters() | 161 ..check_getters() |
| 174 ..check_explicit_values(); | 162 ..check_explicit_values(); |
| 175 } | 163 } |
| 176 } | 164 } |
| 177 | 165 |
| 178 | 166 |
| 179 /** | 167 /** |
| 180 * Helper class for testing invariants of enumerated types. | 168 * Helper class for testing invariants of enumerated types. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 265 |
| 278 // Check that the set of ordinals runs from 0 to N-1, where N is the number | 266 // Check that the set of ordinals runs from 0 to N-1, where N is the number |
| 279 // of enumerated values. | 267 // of enumerated values. |
| 280 Set<int> expectedOrdinals = new Set<int>(); | 268 Set<int> expectedOrdinals = new Set<int>(); |
| 281 for (int i = 0; i < numValues; i++) { | 269 for (int i = 0; i < numValues; i++) { |
| 282 expectedOrdinals.add(i); | 270 expectedOrdinals.add(i); |
| 283 } | 271 } |
| 284 expect(ordinals.keys.toSet(), equals(expectedOrdinals)); | 272 expect(ordinals.keys.toSet(), equals(expectedOrdinals)); |
| 285 } | 273 } |
| 286 } | 274 } |
| OLD | NEW |