| 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.element_test; | 8 library engine.element_test; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| 11 import 'package:analyzer/src/generated/element.dart'; | 11 import 'package:analyzer/src/generated/element.dart'; |
| 12 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext, | 12 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext, |
| 13 AnalysisContextImpl; | 13 AnalysisContextImpl; |
| 14 import 'package:analyzer/src/generated/java_core.dart'; | 14 import 'package:analyzer/src/generated/java_core.dart'; |
| 15 import 'package:analyzer/src/generated/source_io.dart'; | 15 import 'package:analyzer/src/generated/source_io.dart'; |
| 16 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 16 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
| 17 import 'package:analyzer/src/generated/testing/element_factory.dart'; | 17 import 'package:analyzer/src/generated/testing/element_factory.dart'; |
| 18 import 'package:unittest/unittest.dart'; | 18 import 'package:unittest/unittest.dart'; |
| 19 | 19 |
| 20 import '../reflective_tests.dart'; | 20 import '../reflective_tests.dart'; |
| 21 import 'resolver_test.dart' show TestTypeProvider, AnalysisContextHelper; | 21 import 'resolver_test.dart' show TestTypeProvider, AnalysisContextHelper; |
| 22 import 'test_support.dart'; | 22 import 'test_support.dart'; |
| 23 | 23 |
| 24 | 24 |
| 25 main() { | 25 main() { |
| 26 groupSep = ' | '; | 26 groupSep = ' | '; |
| 27 runReflectiveTests(AngularPropertyKindTest); | |
| 28 runReflectiveTests(ElementKindTest); | 27 runReflectiveTests(ElementKindTest); |
| 29 runReflectiveTests(FunctionTypeImplTest); | 28 runReflectiveTests(FunctionTypeImplTest); |
| 30 runReflectiveTests(InterfaceTypeImplTest); | 29 runReflectiveTests(InterfaceTypeImplTest); |
| 31 runReflectiveTests(TypeParameterTypeImplTest); | 30 runReflectiveTests(TypeParameterTypeImplTest); |
| 32 runReflectiveTests(UnionTypeImplTest); | 31 runReflectiveTests(UnionTypeImplTest); |
| 33 runReflectiveTests(VoidTypeImplTest); | 32 runReflectiveTests(VoidTypeImplTest); |
| 34 runReflectiveTests(ClassElementImplTest); | 33 runReflectiveTests(ClassElementImplTest); |
| 35 runReflectiveTests(CompilationUnitElementImplTest); | 34 runReflectiveTests(CompilationUnitElementImplTest); |
| 36 runReflectiveTests(ElementLocationImplTest); | 35 runReflectiveTests(ElementLocationImplTest); |
| 37 runReflectiveTests(ElementImplTest); | 36 runReflectiveTests(ElementImplTest); |
| 38 runReflectiveTests(HtmlElementImplTest); | 37 runReflectiveTests(HtmlElementImplTest); |
| 39 runReflectiveTests(LibraryElementImplTest); | 38 runReflectiveTests(LibraryElementImplTest); |
| 40 runReflectiveTests(MultiplyDefinedElementImplTest); | 39 runReflectiveTests(MultiplyDefinedElementImplTest); |
| 41 } | 40 } |
| 42 | 41 |
| 43 @ReflectiveTestCase() | 42 @ReflectiveTestCase() |
| 44 class AngularPropertyKindTest extends EngineTestCase { | |
| 45 void test_ATTR() { | |
| 46 AngularPropertyKind kind = AngularPropertyKind.ATTR; | |
| 47 expect(kind.callsGetter(), isFalse); | |
| 48 expect(kind.callsSetter(), isTrue); | |
| 49 } | |
| 50 | |
| 51 void test_CALLBACK() { | |
| 52 AngularPropertyKind kind = AngularPropertyKind.CALLBACK; | |
| 53 expect(kind.callsGetter(), isFalse); | |
| 54 expect(kind.callsSetter(), isTrue); | |
| 55 } | |
| 56 | |
| 57 void test_ONE_WAY() { | |
| 58 AngularPropertyKind kind = AngularPropertyKind.ONE_WAY; | |
| 59 expect(kind.callsGetter(), isFalse); | |
| 60 expect(kind.callsSetter(), isTrue); | |
| 61 } | |
| 62 | |
| 63 void test_ONE_WAY_ONE_TIME() { | |
| 64 AngularPropertyKind kind = AngularPropertyKind.ONE_WAY_ONE_TIME; | |
| 65 expect(kind.callsGetter(), isFalse); | |
| 66 expect(kind.callsSetter(), isTrue); | |
| 67 } | |
| 68 | |
| 69 void test_TWO_WAY() { | |
| 70 AngularPropertyKind kind = AngularPropertyKind.TWO_WAY; | |
| 71 expect(kind.callsGetter(), isTrue); | |
| 72 expect(kind.callsSetter(), isTrue); | |
| 73 } | |
| 74 } | |
| 75 | |
| 76 @ReflectiveTestCase() | |
| 77 class ClassElementImplTest extends EngineTestCase { | 43 class ClassElementImplTest extends EngineTestCase { |
| 78 void test_getAllSupertypes_interface() { | 44 void test_getAllSupertypes_interface() { |
| 79 ClassElement classA = ElementFactory.classElement2("A"); | 45 ClassElement classA = ElementFactory.classElement2("A"); |
| 80 ClassElement classB = ElementFactory.classElement("B", classA.type); | 46 ClassElement classB = ElementFactory.classElement("B", classA.type); |
| 81 ClassElementImpl elementC = ElementFactory.classElement2("C"); | 47 ClassElementImpl elementC = ElementFactory.classElement2("C"); |
| 82 InterfaceType typeObject = classA.supertype; | 48 InterfaceType typeObject = classA.supertype; |
| 83 InterfaceType typeA = classA.type; | 49 InterfaceType typeA = classA.type; |
| 84 InterfaceType typeB = classB.type; | 50 InterfaceType typeB = classB.type; |
| 85 InterfaceType typeC = elementC.type; | 51 InterfaceType typeC = elementC.type; |
| 86 elementC.interfaces = <InterfaceType>[typeB]; | 52 elementC.interfaces = <InterfaceType>[typeB]; |
| (...skipping 3899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3986 | 3952 |
| 3987 class _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction extends | 3953 class _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction extends |
| 3988 InterfaceTypeImpl { | 3954 InterfaceTypeImpl { |
| 3989 | 3955 |
| 3990 _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(ClassElement arg0) | 3956 _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(ClassElement arg0) |
| 3991 : super.con1(arg0); | 3957 : super.con1(arg0); |
| 3992 | 3958 |
| 3993 @override | 3959 @override |
| 3994 bool get isDartCoreFunction => true; | 3960 bool get isDartCoreFunction => true; |
| 3995 } | 3961 } |
| OLD | NEW |