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

Unified Diff: pkg/analyzer_experimental/test/generated/element_test.dart

Issue 14050010: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
Index: pkg/analyzer_experimental/test/generated/element_test.dart
diff --git a/pkg/analyzer_experimental/test/generated/element_test.dart b/pkg/analyzer_experimental/test/generated/element_test.dart
index 834b925095286cfddba6e023f38ba484060f896e..0a138ba45eaf646600b182a9bd10299454e0e3d7 100644
--- a/pkg/analyzer_experimental/test/generated/element_test.dart
+++ b/pkg/analyzer_experimental/test/generated/element_test.dart
@@ -1475,6 +1475,7 @@ class ElementFactory {
}
return field;
}
+ static FieldFormalParameterElementImpl fieldFormalParameter(Identifier name) => new FieldFormalParameterElementImpl(name);
static FunctionElementImpl functionElement(String functionName) => functionElement4(functionName, null, null, null, null);
static FunctionElementImpl functionElement2(String functionName, ClassElement returnElement) => functionElement3(functionName, returnElement, null, null);
static FunctionElementImpl functionElement3(String functionName, ClassElement returnElement, List<ClassElement> normalParameters, List<ClassElement> optionalParameters) {
@@ -1630,6 +1631,26 @@ class ElementFactory {
ElementFactory() {
}
}
+class ElementKindTest extends EngineTestCase {
+ void test_of_nonNull() {
+ JUnitTestCase.assertSame(ElementKind.CLASS, ElementKind.of(ElementFactory.classElement2("A", [])));
+ }
+ void test_of_null() {
+ JUnitTestCase.assertSame(ElementKind.ERROR, ElementKind.of(null));
+ }
+ static dartSuite() {
+ _ut.group('ElementKindTest', () {
+ _ut.test('test_of_nonNull', () {
+ final __test = new ElementKindTest();
+ runJUnitTest(__test, __test.test_of_nonNull);
+ });
+ _ut.test('test_of_null', () {
+ final __test = new ElementKindTest();
+ runJUnitTest(__test, __test.test_of_null);
+ });
+ });
+ }
+}
class ClassElementImplTest extends EngineTestCase {
void test_getAllSupertypes_interface() {
ClassElement classA = ElementFactory.classElement2("A", []);
@@ -1671,6 +1692,7 @@ class ClassElementImplTest extends EngineTestCase {
MethodElement method = ElementFactory.methodElement(methodName, null, []);
classA.methods = <MethodElement> [method];
JUnitTestCase.assertSame(method, classA.getMethod(methodName));
+ JUnitTestCase.assertSame(method, classA.getExecutable(methodName));
}
void test_getMethod_undeclared() {
ClassElementImpl classA = ElementFactory.classElement2("A", []);
@@ -1678,6 +1700,7 @@ class ClassElementImplTest extends EngineTestCase {
MethodElement method = ElementFactory.methodElement(methodName, null, []);
classA.methods = <MethodElement> [method];
JUnitTestCase.assertNull(classA.getMethod("${methodName}x"));
+ JUnitTestCase.assertNull(classA.getExecutable("${methodName}x"));
}
void test_lookUpGetter_declared() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1687,6 +1710,7 @@ class ClassElementImplTest extends EngineTestCase {
classA.accessors = <PropertyAccessorElement> [getter];
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
JUnitTestCase.assertSame(getter, classA.lookUpGetter(getterName, library2));
+ JUnitTestCase.assertSame(getter, classA.lookUpExecutable(getterName, library2));
}
void test_lookUpGetter_inherited() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1697,12 +1721,14 @@ class ClassElementImplTest extends EngineTestCase {
ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
JUnitTestCase.assertSame(getter, classB.lookUpGetter(getterName, library2));
+ JUnitTestCase.assertSame(getter, classB.lookUpExecutable(getterName, library2));
}
void test_lookUpGetter_undeclared() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
ClassElementImpl classA = ElementFactory.classElement2("A", []);
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
JUnitTestCase.assertNull(classA.lookUpGetter("g", library2));
+ JUnitTestCase.assertNull(classA.lookUpExecutable("g", library2));
}
void test_lookUpMethod_declared() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1712,6 +1738,7 @@ class ClassElementImplTest extends EngineTestCase {
classA.methods = <MethodElement> [method];
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
JUnitTestCase.assertSame(method, classA.lookUpMethod(methodName, library2));
+ JUnitTestCase.assertSame(method, classA.lookUpExecutable(methodName, library2));
}
void test_lookUpMethod_inherited() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1722,12 +1749,14 @@ class ClassElementImplTest extends EngineTestCase {
ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
JUnitTestCase.assertSame(method, classB.lookUpMethod(methodName, library2));
+ JUnitTestCase.assertSame(method, classB.lookUpExecutable(methodName, library2));
}
void test_lookUpMethod_undeclared() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
ClassElementImpl classA = ElementFactory.classElement2("A", []);
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
JUnitTestCase.assertNull(classA.lookUpMethod("m", library2));
+ JUnitTestCase.assertNull(classA.lookUpExecutable("m", library2));
}
void test_lookUpSetter_declared() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1737,6 +1766,7 @@ class ClassElementImplTest extends EngineTestCase {
classA.accessors = <PropertyAccessorElement> [setter];
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
JUnitTestCase.assertSame(setter, classA.lookUpSetter(setterName, library2));
+ JUnitTestCase.assertSame(setter, classA.lookUpExecutable(setterName, library2));
}
void test_lookUpSetter_inherited() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
@@ -1747,12 +1777,14 @@ class ClassElementImplTest extends EngineTestCase {
ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []);
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA, classB];
JUnitTestCase.assertSame(setter, classB.lookUpSetter(setterName, library2));
+ JUnitTestCase.assertSame(setter, classB.lookUpExecutable(setterName, library2));
}
void test_lookUpSetter_undeclared() {
LibraryElementImpl library2 = ElementFactory.library(createAnalysisContext(), "lib");
ClassElementImpl classA = ElementFactory.classElement2("A", []);
((library2.definingCompilationUnit as CompilationUnitElementImpl)).types = <ClassElement> [classA];
JUnitTestCase.assertNull(classA.lookUpSetter("s", library2));
+ JUnitTestCase.assertNull(classA.lookUpExecutable("s", library2));
}
static dartSuite() {
_ut.group('ClassElementImplTest', () {
@@ -2332,6 +2364,7 @@ class InterfaceTypeImpl_18 extends InterfaceTypeImpl {
bool isDartCoreFunction() => true;
}
main() {
+ ElementKindTest.dartSuite();
FunctionTypeImplTest.dartSuite();
InterfaceTypeImplTest.dartSuite();
TypeVariableTypeImplTest.dartSuite();

Powered by Google App Engine
This is Rietveld 408576698