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

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

Issue 742013003: Code clean-up (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
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/element.dart'; 9 import 'package:analyzer/src/generated/element.dart';
10 import 'package:analyzer/src/generated/engine.dart'; 10 import 'package:analyzer/src/generated/engine.dart';
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 ..check_getters() 88 ..check_getters()
89 ..check_explicit_values(); 89 ..check_explicit_values();
90 } 90 }
91 91
92 void test_InstrumentationLevel() { 92 void test_InstrumentationLevel() {
93 new EnumTester<InstrumentationLevel>() 93 new EnumTester<InstrumentationLevel>()
94 ..check_getters() 94 ..check_getters()
95 ..check_explicit_values(); 95 ..check_explicit_values();
96 } 96 }
97 97
98 void test_Keyword() {
99 new EnumTester<scanner.Keyword>(ignoreGetters: ['keywords'])
100 ..check_getters()
101 ..check_explicit_values();
102 }
103
104 void test_Modifier() { 98 void test_Modifier() {
105 new EnumTester<Modifier>() 99 new EnumTester<Modifier>()
106 ..check_getters() 100 ..check_getters()
107 ..check_explicit_values(); 101 ..check_explicit_values();
108 } 102 }
109 103
110 void test_ParameterKind() { 104 void test_ParameterKind() {
111 new EnumTester<ParameterKind>() 105 new EnumTester<ParameterKind>()
112 ..check_getters() 106 ..check_getters()
113 ..check_explicit_values(); 107 ..check_explicit_values();
114 } 108 }
115 109
116 void test_RedirectingConstructorKind() { 110 void test_RedirectingConstructorKind() {
117 new EnumTester<RedirectingConstructorKind>() 111 new EnumTester<RedirectingConstructorKind>()
118 ..check_getters() 112 ..check_getters()
119 ..check_explicit_values(); 113 ..check_explicit_values();
120 } 114 }
121 115
122 void test_RetentionPriority() { 116 void test_RetentionPriority() {
123 new EnumTester<RetentionPriority>() 117 new EnumTester<RetentionPriority>()
124 ..check_getters() 118 ..check_getters()
125 ..check_explicit_values(); 119 ..check_explicit_values();
126 } 120 }
127 121
128 void test_scanner_TokenType() {
129 new EnumTester<scanner.TokenType>()
130 ..check_getters()
131 ..check_explicit_values();
132 }
133
134 void test_SourceKind() { 122 void test_SourceKind() {
135 new EnumTester<SourceKind>() 123 new EnumTester<SourceKind>()
136 ..check_getters() 124 ..check_getters()
137 ..check_explicit_values(); 125 ..check_explicit_values();
138 } 126 }
139 127
140 void test_SourcePriority() { 128 void test_SourcePriority() {
141 new EnumTester<SourcePriority>() 129 new EnumTester<SourcePriority>()
142 ..check_getters() 130 ..check_getters()
143 ..check_explicit_values(); 131 ..check_explicit_values();
144 } 132 }
145 133
146 void test_TokenClass() {
147 new EnumTester<scanner.TokenClass>()
148 ..check_getters()
149 ..check_explicit_values();
150 }
151
152 void test_UriKind() { 134 void test_UriKind() {
153 new EnumTester<UriKind>() 135 new EnumTester<UriKind>()
154 ..check_getters() 136 ..check_getters()
155 ..check_explicit_values(); 137 ..check_explicit_values();
156 } 138 }
157 139
158 void test_WrapperKind() { 140 void test_WrapperKind() {
159 new EnumTester<WrapperKind>() 141 new EnumTester<WrapperKind>()
160 ..check_getters() 142 ..check_getters()
161 ..check_explicit_values(); 143 ..check_explicit_values();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 246
265 // Check that the set of ordinals runs from 0 to N-1, where N is the number 247 // Check that the set of ordinals runs from 0 to N-1, where N is the number
266 // of enumerated values. 248 // of enumerated values.
267 Set<int> expectedOrdinals = new Set<int>(); 249 Set<int> expectedOrdinals = new Set<int>();
268 for (int i = 0; i < numValues; i++) { 250 for (int i = 0; i < numValues; i++) {
269 expectedOrdinals.add(i); 251 expectedOrdinals.add(i);
270 } 252 }
271 expect(ordinals.keys.toSet(), equals(expectedOrdinals)); 253 expect(ordinals.keys.toSet(), equals(expectedOrdinals));
272 } 254 }
273 } 255 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/scanner.dart ('k') | pkg/analyzer/test/generated/scanner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698