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

Side by Side Diff: pkg/analyzer/test/enum_test.dart

Issue 706823003: Clean up error codes implementation (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 30
31 31
32 @ReflectiveTestCase() 32 @ReflectiveTestCase()
33 class EnumTest { 33 class EnumTest {
34 void test_AnalysisLevel() { 34 void test_AnalysisLevel() {
35 new EnumTester<AnalysisLevel>() 35 new EnumTester<AnalysisLevel>()
36 ..check_getters() 36 ..check_getters()
37 ..check_explicit_values(); 37 ..check_explicit_values();
38 } 38 }
39 39
40 void test_AngularCode() {
41 new EnumTester<AngularCode>()
42 ..check_getters()
43 ..check_explicit_values();
44 }
45
46 void test_AngularPropertyKind() { 40 void test_AngularPropertyKind() {
47 new EnumTester<AngularPropertyKind>() 41 new EnumTester<AngularPropertyKind>()
48 ..check_getters() 42 ..check_getters()
49 ..check_explicit_values(); 43 ..check_explicit_values();
50 } 44 }
51 45
52 void test_AssignmentKind() { 46 void test_AssignmentKind() {
53 new EnumTester<AssignmentKind>() 47 new EnumTester<AssignmentKind>()
54 ..check_getters() 48 ..check_getters()
55 ..check_explicit_values(); 49 ..check_explicit_values();
56 } 50 }
57 51
58 void test_CacheState() { 52 void test_CacheState() {
59 new EnumTester<CacheState>() 53 new EnumTester<CacheState>()
60 ..check_getters() 54 ..check_getters()
61 ..check_explicit_values(); 55 ..check_explicit_values();
62 } 56 }
63 57
64 void test_CheckedModeCompileTimeErrorCode() {
65 new EnumTester<CheckedModeCompileTimeErrorCode>()
66 ..check_getters()
67 ..check_explicit_values();
68 }
69
70 void test_CommentType() { 58 void test_CommentType() {
71 new EnumTester<CommentType>() 59 new EnumTester<CommentType>()
72 ..check_getters() 60 ..check_getters()
73 ..check_explicit_values(); 61 ..check_explicit_values();
74 } 62 }
75 63
76 void test_CompileTimeErrorCode() {
77 new EnumTester<CompileTimeErrorCode>()
78 ..check_getters()
79 ..check_explicit_values();
80 }
81
82 void test_ElementKind() { 64 void test_ElementKind() {
83 new EnumTester<ElementKind>() 65 new EnumTester<ElementKind>()
84 ..check_getters() 66 ..check_getters()
85 ..check_explicit_values(); 67 ..check_explicit_values();
86 } 68 }
87 69
88 void test_ErrorProperty() { 70 void test_ErrorProperty() {
89 new EnumTester<ErrorProperty>() 71 new EnumTester<ErrorProperty>()
90 ..check_getters() 72 ..check_getters()
91 ..check_explicit_values(); 73 ..check_explicit_values();
92 } 74 }
93 75
94 void test_ErrorSeverity() { 76 void test_ErrorSeverity() {
95 new EnumTester<ErrorSeverity>() 77 new EnumTester<ErrorSeverity>()
96 ..check_getters() 78 ..check_getters()
97 ..check_explicit_values(); 79 ..check_explicit_values();
98 } 80 }
99 81
100 void test_ErrorType() { 82 void test_ErrorType() {
101 new EnumTester<ErrorType>() 83 new EnumTester<ErrorType>()
102 ..check_getters() 84 ..check_getters()
103 ..check_explicit_values(); 85 ..check_explicit_values();
104 } 86 }
105 87
106 void test_HintCode() {
107 new EnumTester<HintCode>()
108 ..check_getters()
109 ..check_explicit_values();
110 }
111
112 void test_html_TokenType() { 88 void test_html_TokenType() {
113 new EnumTester<html.TokenType>() 89 new EnumTester<html.TokenType>()
114 ..check_getters() 90 ..check_getters()
115 ..check_explicit_values(); 91 ..check_explicit_values();
116 } 92 }
117 93
118 void test_HtmlWarningCode() {
119 new EnumTester<HtmlWarningCode>()
120 ..check_getters()
121 ..check_explicit_values();
122 }
123
124 void test_INIT_STATE() { 94 void test_INIT_STATE() {
125 new EnumTester<INIT_STATE>() 95 new EnumTester<INIT_STATE>()
126 ..check_getters() 96 ..check_getters()
127 ..check_explicit_values(); 97 ..check_explicit_values();
128 } 98 }
129 99
130 void test_InstrumentationLevel() { 100 void test_InstrumentationLevel() {
131 new EnumTester<InstrumentationLevel>() 101 new EnumTester<InstrumentationLevel>()
132 ..check_getters() 102 ..check_getters()
133 ..check_explicit_values(); 103 ..check_explicit_values();
(...skipping 16 matching lines...) Expand all
150 ..check_getters() 120 ..check_getters()
151 ..check_explicit_values(); 121 ..check_explicit_values();
152 } 122 }
153 123
154 void test_ParserErrorCode() { 124 void test_ParserErrorCode() {
155 new EnumTester<ParserErrorCode>() 125 new EnumTester<ParserErrorCode>()
156 ..check_getters() 126 ..check_getters()
157 ..check_explicit_values(); 127 ..check_explicit_values();
158 } 128 }
159 129
160 void test_PolymerCode() {
161 new EnumTester<PolymerCode>()
162 ..check_getters()
163 ..check_explicit_values();
164 }
165
166 void test_RedirectingConstructorKind() { 130 void test_RedirectingConstructorKind() {
167 new EnumTester<RedirectingConstructorKind>() 131 new EnumTester<RedirectingConstructorKind>()
168 ..check_getters() 132 ..check_getters()
169 ..check_explicit_values(); 133 ..check_explicit_values();
170 } 134 }
171 135
172 void test_ResolverErrorCode() { 136 void test_ResolverErrorCode() {
173 new EnumTester<ResolverErrorCode>() 137 new EnumTester<ResolverErrorCode>()
174 ..check_getters() 138 ..check_getters()
175 ..check_explicit_values(); 139 ..check_explicit_values();
(...skipping 22 matching lines...) Expand all
198 ..check_getters() 162 ..check_getters()
199 ..check_explicit_values(); 163 ..check_explicit_values();
200 } 164 }
201 165
202 void test_SourcePriority() { 166 void test_SourcePriority() {
203 new EnumTester<SourcePriority>() 167 new EnumTester<SourcePriority>()
204 ..check_getters() 168 ..check_getters()
205 ..check_explicit_values(); 169 ..check_explicit_values();
206 } 170 }
207 171
208 void test_StaticTypeWarningCode() {
209 new EnumTester<StaticTypeWarningCode>()
210 ..check_getters()
211 ..check_explicit_values();
212 }
213
214 void test_StaticWarningCode() {
215 new EnumTester<StaticWarningCode>()
216 ..check_getters()
217 ..check_explicit_values();
218 }
219
220 void test_TodoCode() {
221 new EnumTester<TodoCode>(ignoreGetters: ['TODO_REGEX'])
222 ..check_getters()
223 ..check_explicit_values();
224 }
225
226 void test_TokenClass() { 172 void test_TokenClass() {
227 new EnumTester<scanner.TokenClass>() 173 new EnumTester<scanner.TokenClass>()
228 ..check_getters() 174 ..check_getters()
229 ..check_explicit_values(); 175 ..check_explicit_values();
230 } 176 }
231 177
232 void test_UriKind() { 178 void test_UriKind() {
233 new EnumTester<UriKind>() 179 new EnumTester<UriKind>()
234 ..check_getters() 180 ..check_getters()
235 ..check_explicit_values(); 181 ..check_explicit_values();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 296
351 // Check that the set of ordinals runs from 0 to N-1, where N is the number 297 // Check that the set of ordinals runs from 0 to N-1, where N is the number
352 // of enumerated values. 298 // of enumerated values.
353 Set<int> expectedOrdinals = new Set<int>(); 299 Set<int> expectedOrdinals = new Set<int>();
354 for (int i = 0; i < numValues; i++) { 300 for (int i = 0; i < numValues; i++) {
355 expectedOrdinals.add(i); 301 expectedOrdinals.add(i);
356 } 302 }
357 expect(ordinals.keys.toSet(), equals(expectedOrdinals)); 303 expect(ordinals.keys.toSet(), equals(expectedOrdinals));
358 } 304 }
359 } 305 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/error.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698