| 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 'package:analysis_server/plugin/protocol/protocol.dart'; | 7 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
| 8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart'; | 8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart'; |
| 9 import 'package:analyzer/dart/ast/ast.dart' as engine; | 9 import 'package:analyzer/dart/ast/ast.dart' as engine; |
| 10 import 'package:analyzer/dart/ast/visitor.dart' as engine; | 10 import 'package:analyzer/dart/ast/visitor.dart' as engine; |
| 11 import 'package:analyzer/dart/element/element.dart' as engine; | 11 import 'package:analyzer/dart/element/element.dart' as engine; |
| 12 import 'package:analyzer/dart/element/type.dart' as engine; | 12 import 'package:analyzer/dart/element/type.dart' as engine; |
| 13 import 'package:analyzer/error/error.dart' as engine; | 13 import 'package:analyzer/error/error.dart' as engine; |
| 14 import 'package:analyzer/src/dart/ast/utilities.dart' as engine; | 14 import 'package:analyzer/src/dart/ast/utilities.dart' as engine; |
| 15 import 'package:analyzer/src/dart/element/element.dart' as engine; | 15 import 'package:analyzer/src/dart/element/element.dart' as engine; |
| 16 import 'package:analyzer/src/error/codes.dart' as engine; | 16 import 'package:analyzer/src/error/codes.dart' as engine; |
| 17 import 'package:analyzer/src/generated/source.dart' as engine; | 17 import 'package:analyzer/src/generated/source.dart' as engine; |
| 18 import 'package:test/test.dart'; | 18 import 'package:test/test.dart'; |
| 19 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 19 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 20 | 20 |
| 21 import '../abstract_context.dart'; | 21 import '../abstract_context.dart'; |
| 22 import '../utils.dart'; | |
| 23 | 22 |
| 24 main() { | 23 main() { |
| 25 initializeTestEnvironment(); | |
| 26 defineReflectiveSuite(() { | 24 defineReflectiveSuite(() { |
| 27 defineReflectiveTests(ElementTest); | 25 defineReflectiveTests(ElementTest); |
| 28 defineReflectiveTests(ElementKindTest); | 26 defineReflectiveTests(ElementKindTest); |
| 29 }); | 27 }); |
| 30 } | 28 } |
| 31 | 29 |
| 32 @reflectiveTest | 30 @reflectiveTest |
| 33 class ElementKindTest { | 31 class ElementKindTest { |
| 34 void test_fromEngine() { | 32 void test_fromEngine() { |
| 35 expect(convertElementKind(engine.ElementKind.CLASS), ElementKind.CLASS); | 33 expect(convertElementKind(engine.ElementKind.CLASS), ElementKind.CLASS); |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 expect(location.offset, 16); | 470 expect(location.offset, 16); |
| 473 expect(location.length, 'mySetter'.length); | 471 expect(location.length, 'mySetter'.length); |
| 474 expect(location.startLine, 2); | 472 expect(location.startLine, 2); |
| 475 expect(location.startColumn, 7); | 473 expect(location.startColumn, 7); |
| 476 } | 474 } |
| 477 expect(element.parameters, '(String x)'); | 475 expect(element.parameters, '(String x)'); |
| 478 expect(element.returnType, isNull); | 476 expect(element.returnType, isNull); |
| 479 expect(element.flags, 0); | 477 expect(element.flags, 0); |
| 480 } | 478 } |
| 481 } | 479 } |
| OLD | NEW |