| 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.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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 expect(element.name, 'myField'); | 297 expect(element.name, 'myField'); |
| 298 { | 298 { |
| 299 Location location = element.location; | 299 Location location = element.location; |
| 300 expect(location.file, '/test.dart'); | 300 expect(location.file, '/test.dart'); |
| 301 expect(location.offset, 25); | 301 expect(location.offset, 25); |
| 302 expect(location.length, 'myField'.length); | 302 expect(location.length, 'myField'.length); |
| 303 expect(location.startLine, 2); | 303 expect(location.startLine, 2); |
| 304 expect(location.startColumn, 16); | 304 expect(location.startColumn, 16); |
| 305 } | 305 } |
| 306 expect(element.parameters, isNull); | 306 expect(element.parameters, isNull); |
| 307 expect(element.returnType, isNull); | 307 expect(element.returnType, 'dynamic'); |
| 308 expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC); | 308 expect(element.flags, Element.FLAG_CONST | Element.FLAG_STATIC); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void test_fromElement_GETTER() { | 311 void test_fromElement_GETTER() { |
| 312 engine.Source source = addSource('/test.dart', ''' | 312 engine.Source source = addSource('/test.dart', ''' |
| 313 class A { | 313 class A { |
| 314 String get myGetter => 42; | 314 String get myGetter => 42; |
| 315 }'''); | 315 }'''); |
| 316 engine.CompilationUnit unit = resolveLibraryUnit(source); | 316 engine.CompilationUnit unit = resolveLibraryUnit(source); |
| 317 engine.PropertyAccessorElement engineElement = | 317 engine.PropertyAccessorElement engineElement = |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 ApiEnum apiValue = convert(engineValue); | 492 ApiEnum apiValue = convert(engineValue); |
| 493 expect(apiValue, equals(expectedResult)); | 493 expect(apiValue, equals(expectedResult)); |
| 494 } | 494 } |
| 495 } else { | 495 } else { |
| 496 ApiEnum apiValue = convert(engineValue); | 496 ApiEnum apiValue = convert(engineValue); |
| 497 expect(apiValue.name, equals(enumName)); | 497 expect(apiValue.name, equals(enumName)); |
| 498 } | 498 } |
| 499 }); | 499 }); |
| 500 } | 500 } |
| 501 } | 501 } |
| OLD | NEW |