| 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 | |
| 4 library engine.element_test; | 3 library engine.element_test; |
| 5 | |
| 6 import 'dart:collection'; | 4 import 'dart:collection'; |
| 7 import 'dart:io'; | 5 import 'dart:io'; |
| 8 import 'package:analyzer_experimental/src/generated/java_core.dart'; | 6 import 'package:analyzer_experimental/src/generated/java_core.dart'; |
| 9 import 'package:analyzer_experimental/src/generated/java_engine.dart'; | 7 import 'package:analyzer_experimental/src/generated/java_engine.dart'; |
| 10 import 'package:analyzer_experimental/src/generated/java_engine_io.dart'; | 8 import 'package:analyzer_experimental/src/generated/java_engine_io.dart'; |
| 11 import 'package:analyzer_experimental/src/generated/java_junit.dart'; | 9 import 'package:analyzer_experimental/src/generated/java_junit.dart'; |
| 12 import 'package:analyzer_experimental/src/generated/source_io.dart'; | 10 import 'package:analyzer_experimental/src/generated/source_io.dart'; |
| 13 import 'package:analyzer_experimental/src/generated/error.dart'; | 11 import 'package:analyzer_experimental/src/generated/error.dart'; |
| 14 import 'package:analyzer_experimental/src/generated/scanner.dart'; | 12 import 'package:analyzer_experimental/src/generated/scanner.dart'; |
| 15 import 'package:analyzer_experimental/src/generated/utilities_dart.dart'; | 13 import 'package:analyzer_experimental/src/generated/utilities_dart.dart'; |
| 16 import 'package:analyzer_experimental/src/generated/ast.dart' hide Annotation; | 14 import 'package:analyzer_experimental/src/generated/ast.dart' hide Annotation; |
| 17 import 'package:analyzer_experimental/src/generated/element.dart' hide Annotatio
n; | 15 import 'package:analyzer_experimental/src/generated/element.dart' hide Annotatio
n; |
| 18 import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisCo
ntext, AnalysisContextImpl; | 16 import 'package:analyzer_experimental/src/generated/engine.dart' show AnalysisCo
ntext, AnalysisContextImpl; |
| 19 import 'package:unittest/unittest.dart' as _ut; | 17 import 'package:unittest/unittest.dart' as _ut; |
| 20 import 'test_support.dart'; | 18 import 'test_support.dart'; |
| 21 import 'scanner_test.dart' show TokenFactory; | 19 import 'scanner_test.dart' show TokenFactory; |
| 22 import 'ast_test.dart' show ASTFactory; | 20 import 'ast_test.dart' show ASTFactory; |
| 23 import 'resolver_test.dart' show TestTypeProvider; | 21 import 'resolver_test.dart' show TestTypeProvider; |
| 24 | |
| 25 class ElementLocationImplTest extends EngineTestCase { | 22 class ElementLocationImplTest extends EngineTestCase { |
| 26 void test_create_encoding() { | 23 void test_create_encoding() { |
| 27 String encoding = "a;b;c"; | 24 String encoding = "a;b;c"; |
| 28 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); | 25 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); |
| 29 JUnitTestCase.assertEquals(encoding, location.encoding); | 26 JUnitTestCase.assertEquals(encoding, location.encoding); |
| 30 } | 27 } |
| 31 void test_equals_equal() { | 28 void test_equals_equal() { |
| 32 String encoding = "a;b;c"; | 29 String encoding = "a;b;c"; |
| 33 ElementLocationImpl first = new ElementLocationImpl.con2(encoding); | 30 ElementLocationImpl first = new ElementLocationImpl.con2(encoding); |
| 34 ElementLocationImpl second = new ElementLocationImpl.con2(encoding); | 31 ElementLocationImpl second = new ElementLocationImpl.con2(encoding); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 runJUnitTest(__test, __test.test_isUpToDate); | 163 runJUnitTest(__test, __test.test_isUpToDate); |
| 167 }); | 164 }); |
| 168 _ut.test('test_setImports', () { | 165 _ut.test('test_setImports', () { |
| 169 final __test = new LibraryElementImplTest(); | 166 final __test = new LibraryElementImplTest(); |
| 170 runJUnitTest(__test, __test.test_setImports); | 167 runJUnitTest(__test, __test.test_setImports); |
| 171 }); | 168 }); |
| 172 }); | 169 }); |
| 173 } | 170 } |
| 174 } | 171 } |
| 175 class InterfaceTypeImplTest extends EngineTestCase { | 172 class InterfaceTypeImplTest extends EngineTestCase { |
| 176 | 173 |
| 177 /** | 174 /** |
| 178 * The type provider used to access the types. | 175 * The type provider used to access the types. |
| 179 */ | 176 */ |
| 180 TestTypeProvider _typeProvider; | 177 TestTypeProvider _typeProvider; |
| 181 void setUp() { | 178 void setUp() { |
| 182 _typeProvider = new TestTypeProvider(); | 179 _typeProvider = new TestTypeProvider(); |
| 183 } | 180 } |
| 184 void test_computeLongestInheritancePathToObject_multipleInterfacePaths() { | 181 void test_computeLongestInheritancePathToObject_multipleInterfacePaths() { |
| 185 ClassElementImpl classA = ElementFactory.classElement2("A", []); | 182 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 186 ClassElementImpl classB = ElementFactory.classElement2("B", []); | 183 ClassElementImpl classB = ElementFactory.classElement2("B", []); |
| (...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1530 final __test = new TypeVariableTypeImplTest(); | 1527 final __test = new TypeVariableTypeImplTest(); |
| 1531 runJUnitTest(__test, __test.test_substitute_equal); | 1528 runJUnitTest(__test, __test.test_substitute_equal); |
| 1532 }); | 1529 }); |
| 1533 _ut.test('test_substitute_notEqual', () { | 1530 _ut.test('test_substitute_notEqual', () { |
| 1534 final __test = new TypeVariableTypeImplTest(); | 1531 final __test = new TypeVariableTypeImplTest(); |
| 1535 runJUnitTest(__test, __test.test_substitute_notEqual); | 1532 runJUnitTest(__test, __test.test_substitute_notEqual); |
| 1536 }); | 1533 }); |
| 1537 }); | 1534 }); |
| 1538 } | 1535 } |
| 1539 } | 1536 } |
| 1540 | |
| 1541 /** | 1537 /** |
| 1542 * The class {@code ElementFactory} defines utility methods used to create eleme
nts for testing | 1538 * The class {@code ElementFactory} defines utility methods used to create eleme
nts for testing |
| 1543 * purposes. The elements that are created are complete in the sense that as muc
h of the element | 1539 * purposes. The elements that are created are complete in the sense that as muc
h of the element |
| 1544 * model as can be created, given the provided information, has been created. | 1540 * model as can be created, given the provided information, has been created. |
| 1545 */ | 1541 */ |
| 1546 class ElementFactory { | 1542 class ElementFactory { |
| 1547 | 1543 |
| 1548 /** | 1544 /** |
| 1549 * The element representing the class 'Object'. | 1545 * The element representing the class 'Object'. |
| 1550 */ | 1546 */ |
| 1551 static ClassElementImpl _objectElement; | 1547 static ClassElementImpl _objectElement; |
| 1552 static ClassElementImpl classElement(String typeName, InterfaceType superclass
Type, List<String> parameterNames) { | 1548 static ClassElementImpl classElement(String typeName, InterfaceType superclass
Type, List<String> parameterNames) { |
| 1553 ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier3(typeN
ame)); | 1549 ClassElementImpl element = new ClassElementImpl(ASTFactory.identifier3(typeN
ame)); |
| 1554 element.supertype = superclassType; | 1550 element.supertype = superclassType; |
| 1555 InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element); | 1551 InterfaceTypeImpl type = new InterfaceTypeImpl.con1(element); |
| 1556 element.type = type; | 1552 element.type = type; |
| 1557 int count = parameterNames.length; | 1553 int count = parameterNames.length; |
| (...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2638 main() { | 2634 main() { |
| 2639 ElementKindTest.dartSuite(); | 2635 ElementKindTest.dartSuite(); |
| 2640 FunctionTypeImplTest.dartSuite(); | 2636 FunctionTypeImplTest.dartSuite(); |
| 2641 InterfaceTypeImplTest.dartSuite(); | 2637 InterfaceTypeImplTest.dartSuite(); |
| 2642 TypeVariableTypeImplTest.dartSuite(); | 2638 TypeVariableTypeImplTest.dartSuite(); |
| 2643 ClassElementImplTest.dartSuite(); | 2639 ClassElementImplTest.dartSuite(); |
| 2644 ElementLocationImplTest.dartSuite(); | 2640 ElementLocationImplTest.dartSuite(); |
| 2645 ElementImplTest.dartSuite(); | 2641 ElementImplTest.dartSuite(); |
| 2646 LibraryElementImplTest.dartSuite(); | 2642 LibraryElementImplTest.dartSuite(); |
| 2647 } | 2643 } |
| OLD | NEW |