| Index: pkg/analyzer/test/generated/element_test.dart
|
| diff --git a/pkg/analyzer/test/generated/element_test.dart b/pkg/analyzer/test/generated/element_test.dart
|
| index 485ffd91bce0f5102224a5c3fc05cdd656c7229a..b53ce4c471e2ed387508fd4afbd9dcdfdfad5a78 100644
|
| --- a/pkg/analyzer/test/generated/element_test.dart
|
| +++ b/pkg/analyzer/test/generated/element_test.dart
|
| @@ -289,6 +289,47 @@ class ClassElementImplTest extends EngineTestCase {
|
| JUnitTestCase.assertNull(classA.lookUpGetter("g", library));
|
| }
|
|
|
| + void test_lookUpInheritedMethod_declared() {
|
| + LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
|
| + ClassElementImpl classA = ElementFactory.classElement2("A", []);
|
| + String methodName = "m";
|
| + MethodElement method = ElementFactory.methodElement(methodName, null, []);
|
| + classA.methods = <MethodElement> [method];
|
| + (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
|
| + JUnitTestCase.assertNull(classA.lookUpInheritedMethod(methodName, library));
|
| + }
|
| +
|
| + void test_lookUpInheritedMethod_declaredAndInherited() {
|
| + LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
|
| + ClassElementImpl classA = ElementFactory.classElement2("A", []);
|
| + String methodName = "m";
|
| + MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
|
| + classA.methods = <MethodElement> [inheritedMethod];
|
| + ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
|
| + MethodElement method = ElementFactory.methodElement(methodName, null, []);
|
| + classB.methods = <MethodElement> [method];
|
| + (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
|
| + JUnitTestCase.assertSame(inheritedMethod, classB.lookUpInheritedMethod(methodName, library));
|
| + }
|
| +
|
| + void test_lookUpInheritedMethod_inherited() {
|
| + LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
|
| + ClassElementImpl classA = ElementFactory.classElement2("A", []);
|
| + String methodName = "m";
|
| + MethodElement inheritedMethod = ElementFactory.methodElement(methodName, null, []);
|
| + classA.methods = <MethodElement> [inheritedMethod];
|
| + ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
|
| + (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA, classB];
|
| + JUnitTestCase.assertSame(inheritedMethod, classB.lookUpInheritedMethod(methodName, library));
|
| + }
|
| +
|
| + void test_lookUpInheritedMethod_undeclared() {
|
| + LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
|
| + ClassElementImpl classA = ElementFactory.classElement2("A", []);
|
| + (library.definingCompilationUnit as CompilationUnitElementImpl).types = <ClassElement> [classA];
|
| + JUnitTestCase.assertNull(classA.lookUpInheritedMethod("m", library));
|
| + }
|
| +
|
| void test_lookUpMethod_declared() {
|
| LibraryElementImpl library = ElementFactory.library(createAnalysisContext(), "lib");
|
| ClassElementImpl classA = ElementFactory.classElement2("A", []);
|
| @@ -453,6 +494,22 @@ class ClassElementImplTest extends EngineTestCase {
|
| final __test = new ClassElementImplTest();
|
| runJUnitTest(__test, __test.test_lookUpGetter_undeclared_recursive);
|
| });
|
| + _ut.test('test_lookUpInheritedMethod_declared', () {
|
| + final __test = new ClassElementImplTest();
|
| + runJUnitTest(__test, __test.test_lookUpInheritedMethod_declared);
|
| + });
|
| + _ut.test('test_lookUpInheritedMethod_declaredAndInherited', () {
|
| + final __test = new ClassElementImplTest();
|
| + runJUnitTest(__test, __test.test_lookUpInheritedMethod_declaredAndInherited);
|
| + });
|
| + _ut.test('test_lookUpInheritedMethod_inherited', () {
|
| + final __test = new ClassElementImplTest();
|
| + runJUnitTest(__test, __test.test_lookUpInheritedMethod_inherited);
|
| + });
|
| + _ut.test('test_lookUpInheritedMethod_undeclared', () {
|
| + final __test = new ClassElementImplTest();
|
| + runJUnitTest(__test, __test.test_lookUpInheritedMethod_undeclared);
|
| + });
|
| _ut.test('test_lookUpMethod_declared', () {
|
| final __test = new ClassElementImplTest();
|
| runJUnitTest(__test, __test.test_lookUpMethod_declared);
|
|
|