Index: pkg/analyzer/test/src/dart/element/element_test.dart |
diff --git a/pkg/analyzer/test/src/dart/element/element_test.dart b/pkg/analyzer/test/src/dart/element/element_test.dart |
index d2aa80d1090ca8decc22d8496050c5f1eeac9420..3de6bdf1845d9f741a05b438cc4e39aa7f38fbfb 100644 |
--- a/pkg/analyzer/test/src/dart/element/element_test.dart |
+++ b/pkg/analyzer/test/src/dart/element/element_test.dart |
@@ -44,6 +44,7 @@ main() { |
runReflectiveTests(MethodElementImplTest); |
runReflectiveTests(MultiplyDefinedElementImplTest); |
runReflectiveTests(ParameterElementImplTest); |
+ runReflectiveTests(PropertyAccessorElementImplTest); |
runReflectiveTests(TopLevelVariableElementImplTest); |
} |
@@ -4184,6 +4185,39 @@ main(int p) { |
} |
} |
+@reflectiveTest |
+class PropertyAccessorElementImplTest extends EngineTestCase { |
Brian Wilkerson
2016/06/07 18:09:05
"PropertyAccessorElementImplTest" --> "PropertyAcc
Paul Berry
2016/06/07 18:26:46
Based purely on functionality, I don't have a pref
|
+ void test_matchesHandle_getter() { |
+ CompilationUnitElementImpl compilationUnitElement = |
+ ElementFactory.compilationUnit('foo.dart'); |
+ LibraryElementImpl libraryElement = ElementFactory.library(null, '') |
+ ..definingCompilationUnit = compilationUnitElement; |
+ PropertyAccessorElementImpl element = |
+ ElementFactory.getterElement('x', true, DynamicTypeImpl.instance); |
+ compilationUnitElement.accessors = <PropertyAccessorElement>[element]; |
+ PropertyAccessorElementHandle handle = |
+ new PropertyAccessorElementHandle(null, element.location); |
+ expect(element.hashCode, handle.hashCode); |
+ expect(element == handle, isTrue); |
+ expect(handle == element, isTrue); |
+ } |
+ |
+ void test_matchesHandle_setter() { |
+ CompilationUnitElementImpl compilationUnitElement = |
+ ElementFactory.compilationUnit('foo.dart'); |
+ LibraryElementImpl libraryElement = ElementFactory.library(null, '') |
+ ..definingCompilationUnit = compilationUnitElement; |
+ PropertyAccessorElementImpl element = |
+ ElementFactory.setterElement('x', true, DynamicTypeImpl.instance); |
+ compilationUnitElement.accessors = <PropertyAccessorElement>[element]; |
+ PropertyAccessorElementHandle handle = |
+ new PropertyAccessorElementHandle(null, element.location); |
+ expect(element.hashCode, handle.hashCode); |
+ expect(element == handle, isTrue); |
+ expect(handle == element, isTrue); |
+ } |
+} |
+ |
class TestElementResynthesizer extends ElementResynthesizer { |
Map<ElementLocation, Element> locationMap; |