| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.element_test; | 4 library engine.element_test; |
| 5 | 5 |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'package:analyzer-experimental/src/generated/java_core.dart'; | 8 import 'package:analyzer-experimental/src/generated/java_core.dart'; |
| 9 import 'package:analyzer-experimental/src/generated/java_engine.dart'; | 9 import 'package:analyzer-experimental/src/generated/java_engine.dart'; |
| 10 import 'package:analyzer-experimental/src/generated/java_engine_io.dart'; | 10 import 'package:analyzer-experimental/src/generated/java_engine_io.dart'; |
| (...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1140 String fileName = "${libraryName}.dart"; | 1140 String fileName = "${libraryName}.dart"; |
| 1141 FileBasedSource source = new FileBasedSource.con1(null, FileUtilities2.creat
eFile(fileName)); | 1141 FileBasedSource source = new FileBasedSource.con1(null, FileUtilities2.creat
eFile(fileName)); |
| 1142 CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName); | 1142 CompilationUnitElementImpl unit = new CompilationUnitElementImpl(fileName); |
| 1143 unit.source = source; | 1143 unit.source = source; |
| 1144 LibraryElementImpl library = new LibraryElementImpl(context, ASTFactory.libr
aryIdentifier2([libraryName])); | 1144 LibraryElementImpl library = new LibraryElementImpl(context, ASTFactory.libr
aryIdentifier2([libraryName])); |
| 1145 library.definingCompilationUnit = unit; | 1145 library.definingCompilationUnit = unit; |
| 1146 return library; | 1146 return library; |
| 1147 } | 1147 } |
| 1148 static LocalVariableElementImpl localVariableElement(Identifier name) => new L
ocalVariableElementImpl(name); | 1148 static LocalVariableElementImpl localVariableElement(Identifier name) => new L
ocalVariableElementImpl(name); |
| 1149 static LocalVariableElementImpl localVariableElement2(String name) => new Loca
lVariableElementImpl(ASTFactory.identifier2(name)); | 1149 static LocalVariableElementImpl localVariableElement2(String name) => new Loca
lVariableElementImpl(ASTFactory.identifier2(name)); |
| 1150 static MethodElementImpl methodElement(String methodName, Type2 returnType11,
List<Type2> argumentTypes) { | 1150 static MethodElementImpl methodElement(String methodName, Type2 returnType12,
List<Type2> argumentTypes) { |
| 1151 MethodElementImpl method = new MethodElementImpl.con1(ASTFactory.identifier2
(methodName)); | 1151 MethodElementImpl method = new MethodElementImpl.con1(ASTFactory.identifier2
(methodName)); |
| 1152 int count = argumentTypes.length; | 1152 int count = argumentTypes.length; |
| 1153 List<ParameterElement> parameters = new List<ParameterElement>(count); | 1153 List<ParameterElement> parameters = new List<ParameterElement>(count); |
| 1154 for (int i = 0; i < count; i++) { | 1154 for (int i = 0; i < count; i++) { |
| 1155 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.ident
ifier2("a${i}")); | 1155 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.ident
ifier2("a${i}")); |
| 1156 parameter.type = argumentTypes[i]; | 1156 parameter.type = argumentTypes[i]; |
| 1157 parameters[i] = parameter; | 1157 parameters[i] = parameter; |
| 1158 } | 1158 } |
| 1159 method.parameters = parameters; | 1159 method.parameters = parameters; |
| 1160 FunctionTypeImpl methodType = new FunctionTypeImpl.con1(method); | 1160 FunctionTypeImpl methodType = new FunctionTypeImpl.con1(method); |
| 1161 methodType.normalParameterTypes = argumentTypes; | 1161 methodType.normalParameterTypes = argumentTypes; |
| 1162 methodType.returnType = returnType11; | 1162 methodType.returnType = returnType12; |
| 1163 method.type = methodType; | 1163 method.type = methodType; |
| 1164 return method; | 1164 return method; |
| 1165 } | 1165 } |
| 1166 static ParameterElementImpl namedParameter(String name) { | 1166 static ParameterElementImpl namedParameter(String name) { |
| 1167 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); | 1167 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); |
| 1168 parameter.parameterKind = ParameterKind.NAMED; | 1168 parameter.parameterKind = ParameterKind.NAMED; |
| 1169 return parameter; | 1169 return parameter; |
| 1170 } | 1170 } |
| 1171 static ParameterElementImpl positionalParameter(String name) { | 1171 static ParameterElementImpl positionalParameter(String name) { |
| 1172 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); | 1172 ParameterElementImpl parameter = new ParameterElementImpl(ASTFactory.identif
ier2(name)); |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1446 Map<String, Type2> types = type.namedParameterTypes; | 1446 Map<String, Type2> types = type.namedParameterTypes; |
| 1447 EngineTestCase.assertSize2(0, types); | 1447 EngineTestCase.assertSize2(0, types); |
| 1448 } | 1448 } |
| 1449 void test_getNormalParameterTypes() { | 1449 void test_getNormalParameterTypes() { |
| 1450 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); | 1450 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); |
| 1451 List<Type2> types = type.normalParameterTypes; | 1451 List<Type2> types = type.normalParameterTypes; |
| 1452 EngineTestCase.assertLength(0, types); | 1452 EngineTestCase.assertLength(0, types); |
| 1453 } | 1453 } |
| 1454 void test_getReturnType() { | 1454 void test_getReturnType() { |
| 1455 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); | 1455 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); |
| 1456 Type2 returnType7 = type.returnType; | 1456 Type2 returnType8 = type.returnType; |
| 1457 JUnitTestCase.assertEquals(VoidTypeImpl.instance, returnType7); | 1457 JUnitTestCase.assertEquals(VoidTypeImpl.instance, returnType8); |
| 1458 } | 1458 } |
| 1459 void test_getTypeArguments() { | 1459 void test_getTypeArguments() { |
| 1460 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); | 1460 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); |
| 1461 List<Type2> types = type.typeArguments; | 1461 List<Type2> types = type.typeArguments; |
| 1462 EngineTestCase.assertLength(0, types); | 1462 EngineTestCase.assertLength(0, types); |
| 1463 } | 1463 } |
| 1464 void test_hashCode_element() { | 1464 void test_hashCode_element() { |
| 1465 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); | 1465 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); |
| 1466 type.hashCode; | 1466 type.hashCode; |
| 1467 } | 1467 } |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); | 1650 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); |
| 1651 List<Type2> expectedTypes = <Type2> [new InterfaceTypeImpl.con1(new ClassEle
mentImpl(ASTFactory.identifier2("C")))]; | 1651 List<Type2> expectedTypes = <Type2> [new InterfaceTypeImpl.con1(new ClassEle
mentImpl(ASTFactory.identifier2("C")))]; |
| 1652 type.normalParameterTypes = expectedTypes; | 1652 type.normalParameterTypes = expectedTypes; |
| 1653 List<Type2> types = type.normalParameterTypes; | 1653 List<Type2> types = type.normalParameterTypes; |
| 1654 JUnitTestCase.assertEquals(expectedTypes, types); | 1654 JUnitTestCase.assertEquals(expectedTypes, types); |
| 1655 } | 1655 } |
| 1656 void test_setReturnType() { | 1656 void test_setReturnType() { |
| 1657 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); | 1657 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); |
| 1658 Type2 expectedType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFact
ory.identifier2("C"))); | 1658 Type2 expectedType = new InterfaceTypeImpl.con1(new ClassElementImpl(ASTFact
ory.identifier2("C"))); |
| 1659 type.returnType = expectedType; | 1659 type.returnType = expectedType; |
| 1660 Type2 returnType8 = type.returnType; | 1660 Type2 returnType9 = type.returnType; |
| 1661 JUnitTestCase.assertEquals(expectedType, returnType8); | 1661 JUnitTestCase.assertEquals(expectedType, returnType9); |
| 1662 } | 1662 } |
| 1663 void test_setTypeArguments() { | 1663 void test_setTypeArguments() { |
| 1664 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); | 1664 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier2("f"))); |
| 1665 Type2 expectedType = new TypeVariableTypeImpl(new TypeVariableElementImpl(AS
TFactory.identifier2("C"))); | 1665 Type2 expectedType = new TypeVariableTypeImpl(new TypeVariableElementImpl(AS
TFactory.identifier2("C"))); |
| 1666 type.typeArguments = <Type2> [expectedType]; | 1666 type.typeArguments = <Type2> [expectedType]; |
| 1667 List<Type2> arguments = type.typeArguments; | 1667 List<Type2> arguments = type.typeArguments; |
| 1668 EngineTestCase.assertLength(1, arguments); | 1668 EngineTestCase.assertLength(1, arguments); |
| 1669 JUnitTestCase.assertEquals(expectedType, arguments[0]); | 1669 JUnitTestCase.assertEquals(expectedType, arguments[0]); |
| 1670 } | 1670 } |
| 1671 void test_substitute2_equal() { | 1671 void test_substitute2_equal() { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1889 } | 1889 } |
| 1890 main() { | 1890 main() { |
| 1891 FunctionTypeImplTest.dartSuite(); | 1891 FunctionTypeImplTest.dartSuite(); |
| 1892 InterfaceTypeImplTest.dartSuite(); | 1892 InterfaceTypeImplTest.dartSuite(); |
| 1893 TypeVariableTypeImplTest.dartSuite(); | 1893 TypeVariableTypeImplTest.dartSuite(); |
| 1894 ClassElementImplTest.dartSuite(); | 1894 ClassElementImplTest.dartSuite(); |
| 1895 ElementLocationImplTest.dartSuite(); | 1895 ElementLocationImplTest.dartSuite(); |
| 1896 ElementImplTest.dartSuite(); | 1896 ElementImplTest.dartSuite(); |
| 1897 LibraryElementImplTest.dartSuite(); | 1897 LibraryElementImplTest.dartSuite(); |
| 1898 } | 1898 } |
| OLD | NEW |