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

Side by Side Diff: pkg/analysis_server/test/protocol_server_test.dart

Issue 1852113002: More strong mode changes in analysis_server (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months 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
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.computer.element; 5 library test.computer.element;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 8
9 import 'package:analysis_server/src/constants.dart'; 9 import 'package:analysis_server/src/constants.dart';
10 import 'package:analysis_server/src/protocol_server.dart'; 10 import 'package:analysis_server/src/protocol_server.dart';
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 {Map<EngineEnum, ApiEnum> exceptions: const {}}) { 166 {Map<EngineEnum, ApiEnum> exceptions: const {}}) {
167 ClassMirror engineClass = reflectClass(EngineEnum); 167 ClassMirror engineClass = reflectClass(EngineEnum);
168 engineClass.staticMembers.forEach((Symbol symbol, MethodMirror method) { 168 engineClass.staticMembers.forEach((Symbol symbol, MethodMirror method) {
169 if (symbol == #values) { 169 if (symbol == #values) {
170 return; 170 return;
171 } 171 }
172 if (!method.isGetter) { 172 if (!method.isGetter) {
173 return; 173 return;
174 } 174 }
175 String enumName = MirrorSystem.getName(symbol); 175 String enumName = MirrorSystem.getName(symbol);
176 EngineEnum engineValue = engineClass.getField(symbol).reflectee; 176 EngineEnum engineValue =
177 engineClass.getField(symbol).reflectee as EngineEnum;
177 expect(engineValue, new isInstanceOf<EngineEnum>()); 178 expect(engineValue, new isInstanceOf<EngineEnum>());
178 if (exceptions.containsKey(engineValue)) { 179 if (exceptions.containsKey(engineValue)) {
179 ApiEnum expectedResult = exceptions[engineValue]; 180 ApiEnum expectedResult = exceptions[engineValue];
180 if (expectedResult == null) { 181 if (expectedResult == null) {
181 expect(() { 182 expect(() {
182 convert(engineValue); 183 convert(engineValue);
183 }, throws); 184 }, throws);
184 } else { 185 } else {
185 ApiEnum apiValue = convert(engineValue); 186 ApiEnum apiValue = convert(engineValue);
186 expect(apiValue, equals(expectedResult)); 187 expect(apiValue, equals(expectedResult));
187 } 188 }
188 } else { 189 } else {
189 ApiEnum apiValue = convert(engineValue); 190 ApiEnum apiValue = convert(engineValue);
190 expect(apiValue.name, equals(enumName)); 191 expect(apiValue.name, equals(enumName));
191 } 192 }
192 }); 193 });
193 } 194 }
194 } 195 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/analysis/update_content_test.dart ('k') | pkg/analysis_server/test/protocol_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698