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

Unified Diff: pkg/analyzer/test/src/dart/element/element_test.dart

Issue 2042393002: Remove unnecessary overrides of PropertyAccessorElementImpl.operator== and hashCode (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698