| 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 'package:analyzer/src/generated/java_core.dart'; | 6 import 'package:analyzer/src/generated/java_core.dart'; |
| 7 import 'package:analyzer/src/generated/java_engine_io.dart'; | 7 import 'package:analyzer/src/generated/java_engine_io.dart'; |
| 8 import 'package:analyzer/src/generated/java_junit.dart'; | 8 import 'package:analyzer/src/generated/java_junit.dart'; |
| 9 import 'package:analyzer/src/generated/source_io.dart'; | 9 import 'package:analyzer/src/generated/source_io.dart'; |
| 10 import 'package:analyzer/src/generated/utilities_dart.dart'; | 10 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| (...skipping 2480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2491 } | 2491 } |
| 2492 | 2492 |
| 2493 void test_getAllSupertypes_recursive() { | 2493 void test_getAllSupertypes_recursive() { |
| 2494 ClassElementImpl classA = ElementFactory.classElement2("A", []); | 2494 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2495 ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []); | 2495 ClassElementImpl classB = ElementFactory.classElement("B", classA.type, []); |
| 2496 classA.supertype = classB.type; | 2496 classA.supertype = classB.type; |
| 2497 List<InterfaceType> supers = classB.allSupertypes; | 2497 List<InterfaceType> supers = classB.allSupertypes; |
| 2498 EngineTestCase.assertLength(1, supers); | 2498 EngineTestCase.assertLength(1, supers); |
| 2499 } | 2499 } |
| 2500 | 2500 |
| 2501 void test_getField() { |
| 2502 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2503 String fieldName = "f"; |
| 2504 FieldElementImpl field = ElementFactory.fieldElement(fieldName, false, false
, false, null); |
| 2505 classA.fields = <FieldElement> [field]; |
| 2506 JUnitTestCase.assertSame(field, classA.getField(fieldName)); |
| 2507 JUnitTestCase.assertSame(null, classA.getField("noSuchField")); |
| 2508 } |
| 2509 |
| 2501 void test_getMethod_declared() { | 2510 void test_getMethod_declared() { |
| 2502 ClassElementImpl classA = ElementFactory.classElement2("A", []); | 2511 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| 2503 String methodName = "m"; | 2512 String methodName = "m"; |
| 2504 MethodElement method = ElementFactory.methodElement(methodName, null, []); | 2513 MethodElement method = ElementFactory.methodElement(methodName, null, []); |
| 2505 classA.methods = <MethodElement> [method]; | 2514 classA.methods = <MethodElement> [method]; |
| 2506 JUnitTestCase.assertSame(method, classA.getMethod(methodName)); | 2515 JUnitTestCase.assertSame(method, classA.getMethod(methodName)); |
| 2507 } | 2516 } |
| 2508 | 2517 |
| 2509 void test_getMethod_undeclared() { | 2518 void test_getMethod_undeclared() { |
| 2510 ClassElementImpl classA = ElementFactory.classElement2("A", []); | 2519 ClassElementImpl classA = ElementFactory.classElement2("A", []); |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2686 runJUnitTest(__test, __test.test_getAllSupertypes_interface); | 2695 runJUnitTest(__test, __test.test_getAllSupertypes_interface); |
| 2687 }); | 2696 }); |
| 2688 _ut.test('test_getAllSupertypes_mixins', () { | 2697 _ut.test('test_getAllSupertypes_mixins', () { |
| 2689 final __test = new ClassElementImplTest(); | 2698 final __test = new ClassElementImplTest(); |
| 2690 runJUnitTest(__test, __test.test_getAllSupertypes_mixins); | 2699 runJUnitTest(__test, __test.test_getAllSupertypes_mixins); |
| 2691 }); | 2700 }); |
| 2692 _ut.test('test_getAllSupertypes_recursive', () { | 2701 _ut.test('test_getAllSupertypes_recursive', () { |
| 2693 final __test = new ClassElementImplTest(); | 2702 final __test = new ClassElementImplTest(); |
| 2694 runJUnitTest(__test, __test.test_getAllSupertypes_recursive); | 2703 runJUnitTest(__test, __test.test_getAllSupertypes_recursive); |
| 2695 }); | 2704 }); |
| 2705 _ut.test('test_getField', () { |
| 2706 final __test = new ClassElementImplTest(); |
| 2707 runJUnitTest(__test, __test.test_getField); |
| 2708 }); |
| 2696 _ut.test('test_getMethod_declared', () { | 2709 _ut.test('test_getMethod_declared', () { |
| 2697 final __test = new ClassElementImplTest(); | 2710 final __test = new ClassElementImplTest(); |
| 2698 runJUnitTest(__test, __test.test_getMethod_declared); | 2711 runJUnitTest(__test, __test.test_getMethod_declared); |
| 2699 }); | 2712 }); |
| 2700 _ut.test('test_getMethod_undeclared', () { | 2713 _ut.test('test_getMethod_undeclared', () { |
| 2701 final __test = new ClassElementImplTest(); | 2714 final __test = new ClassElementImplTest(); |
| 2702 runJUnitTest(__test, __test.test_getMethod_undeclared); | 2715 runJUnitTest(__test, __test.test_getMethod_undeclared); |
| 2703 }); | 2716 }); |
| 2704 _ut.test('test_getNode', () { | 2717 _ut.test('test_getNode', () { |
| 2705 final __test = new ClassElementImplTest(); | 2718 final __test = new ClassElementImplTest(); |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2969 FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [
a]).type; | 2982 FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [
a]).type; |
| 2970 FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).ty
pe; | 2983 FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).ty
pe; |
| 2971 JUnitTestCase.assertTrue(t.isSubtypeOf(s)); | 2984 JUnitTestCase.assertTrue(t.isSubtypeOf(s)); |
| 2972 JUnitTestCase.assertFalse(s.isSubtypeOf(t)); | 2985 JUnitTestCase.assertFalse(s.isSubtypeOf(t)); |
| 2973 JUnitTestCase.assertTrue(t.isAssignableTo(s)); | 2986 JUnitTestCase.assertTrue(t.isAssignableTo(s)); |
| 2974 JUnitTestCase.assertFalse(s.isAssignableTo(t)); | 2987 JUnitTestCase.assertFalse(s.isAssignableTo(t)); |
| 2975 } | 2988 } |
| 2976 | 2989 |
| 2977 void test_isSubtypeOf_baseCase_classFunction() { | 2990 void test_isSubtypeOf_baseCase_classFunction() { |
| 2978 ClassElementImpl functionElement = ElementFactory.classElement2("Function",
[]); | 2991 ClassElementImpl functionElement = ElementFactory.classElement2("Function",
[]); |
| 2979 InterfaceTypeImpl functionType = new InterfaceTypeImpl_27(functionElement); | 2992 InterfaceTypeImpl functionType = new InterfaceTypeImpl_29(functionElement); |
| 2980 FunctionType f = ElementFactory.functionElement("f").type; | 2993 FunctionType f = ElementFactory.functionElement("f").type; |
| 2981 JUnitTestCase.assertTrue(f.isSubtypeOf(functionType)); | 2994 JUnitTestCase.assertTrue(f.isSubtypeOf(functionType)); |
| 2982 } | 2995 } |
| 2983 | 2996 |
| 2984 void test_isSubtypeOf_baseCase_notFunctionType() { | 2997 void test_isSubtypeOf_baseCase_notFunctionType() { |
| 2985 FunctionType f = ElementFactory.functionElement("f").type; | 2998 FunctionType f = ElementFactory.functionElement("f").type; |
| 2986 InterfaceType t = ElementFactory.classElement2("C", []).type; | 2999 InterfaceType t = ElementFactory.classElement2("C", []).type; |
| 2987 JUnitTestCase.assertFalse(f.isSubtypeOf(t)); | 3000 JUnitTestCase.assertFalse(f.isSubtypeOf(t)); |
| 2988 } | 3001 } |
| 2989 | 3002 |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3468 runJUnitTest(__test, __test.test_substitute2_equal); | 3481 runJUnitTest(__test, __test.test_substitute2_equal); |
| 3469 }); | 3482 }); |
| 3470 _ut.test('test_substitute2_notEqual', () { | 3483 _ut.test('test_substitute2_notEqual', () { |
| 3471 final __test = new FunctionTypeImplTest(); | 3484 final __test = new FunctionTypeImplTest(); |
| 3472 runJUnitTest(__test, __test.test_substitute2_notEqual); | 3485 runJUnitTest(__test, __test.test_substitute2_notEqual); |
| 3473 }); | 3486 }); |
| 3474 }); | 3487 }); |
| 3475 } | 3488 } |
| 3476 } | 3489 } |
| 3477 | 3490 |
| 3478 class InterfaceTypeImpl_27 extends InterfaceTypeImpl { | 3491 class InterfaceTypeImpl_29 extends InterfaceTypeImpl { |
| 3479 InterfaceTypeImpl_27(ClassElement arg0) : super.con1(arg0); | 3492 InterfaceTypeImpl_29(ClassElement arg0) : super.con1(arg0); |
| 3480 | 3493 |
| 3481 bool get isDartCoreFunction => true; | 3494 bool get isDartCoreFunction => true; |
| 3482 } | 3495 } |
| 3483 | 3496 |
| 3484 main() { | 3497 main() { |
| 3485 ElementKindTest.dartSuite(); | 3498 ElementKindTest.dartSuite(); |
| 3486 FunctionTypeImplTest.dartSuite(); | 3499 FunctionTypeImplTest.dartSuite(); |
| 3487 InterfaceTypeImplTest.dartSuite(); | 3500 InterfaceTypeImplTest.dartSuite(); |
| 3488 TypeParameterTypeImplTest.dartSuite(); | 3501 TypeParameterTypeImplTest.dartSuite(); |
| 3489 VoidTypeImplTest.dartSuite(); | 3502 VoidTypeImplTest.dartSuite(); |
| 3490 ClassElementImplTest.dartSuite(); | 3503 ClassElementImplTest.dartSuite(); |
| 3491 ElementLocationImplTest.dartSuite(); | 3504 ElementLocationImplTest.dartSuite(); |
| 3492 ElementImplTest.dartSuite(); | 3505 ElementImplTest.dartSuite(); |
| 3493 LibraryElementImplTest.dartSuite(); | 3506 LibraryElementImplTest.dartSuite(); |
| 3494 MultiplyDefinedElementImplTest.dartSuite(); | 3507 MultiplyDefinedElementImplTest.dartSuite(); |
| 3495 } | 3508 } |
| OLD | NEW |