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

Side by Side Diff: pkg/analyzer/test/generated/element_test.dart

Issue 103233003: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/test/generated/ast_test.dart ('k') | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 InterfaceType type = ElementFactory.classElement2("A", []).type; 1014 InterfaceType type = ElementFactory.classElement2("A", []).type;
1015 EngineTestCase.assertLength(0, type.typeArguments); 1015 EngineTestCase.assertLength(0, type.typeArguments);
1016 } 1016 }
1017 1017
1018 void test_hashCode() { 1018 void test_hashCode() {
1019 ClassElement classA = ElementFactory.classElement2("A", []); 1019 ClassElement classA = ElementFactory.classElement2("A", []);
1020 InterfaceType typeA = classA.type; 1020 InterfaceType typeA = classA.type;
1021 JUnitTestCase.assertFalse(0 == typeA.hashCode); 1021 JUnitTestCase.assertFalse(0 == typeA.hashCode);
1022 } 1022 }
1023 1023
1024 void test_isAssignableTo_typeVariables() {
1025 ClassElement classA = ElementFactory.classElement2("A", ["E"]);
1026 ClassElement classB = ElementFactory.classElement2("B", ["F", "G"]);
1027 InterfaceTypeImpl typeAF = new InterfaceTypeImpl.con1(classA);
1028 typeAF.typeArguments = <Type2> [classB.typeParameters[0].type];
1029 InterfaceTypeImpl typeAG = new InterfaceTypeImpl.con1(classA);
1030 typeAG.typeArguments = <Type2> [classB.typeParameters[1].type];
1031 JUnitTestCase.assertFalse(typeAG.isAssignableTo(typeAF));
1032 }
1033
1034 void test_isAssignableTo_void() {
1035 JUnitTestCase.assertFalse(VoidTypeImpl.instance.isAssignableTo(_typeProvider .intType));
1036 }
1037
1024 void test_isDirectSupertypeOf_extends() { 1038 void test_isDirectSupertypeOf_extends() {
1025 ClassElement classA = ElementFactory.classElement2("A", []); 1039 ClassElement classA = ElementFactory.classElement2("A", []);
1026 ClassElement classB = ElementFactory.classElement("B", classA.type, []); 1040 ClassElement classB = ElementFactory.classElement("B", classA.type, []);
1027 InterfaceType typeA = classA.type; 1041 InterfaceType typeA = classA.type;
1028 InterfaceType typeB = classB.type; 1042 InterfaceType typeB = classB.type;
1029 JUnitTestCase.assertTrue(typeA.isDirectSupertypeOf(typeB)); 1043 JUnitTestCase.assertTrue(typeA.isDirectSupertypeOf(typeB));
1030 } 1044 }
1031 1045
1032 void test_isDirectSupertypeOf_false() { 1046 void test_isDirectSupertypeOf_false() {
1033 ClassElement classA = ElementFactory.classElement2("A", []); 1047 ClassElement classA = ElementFactory.classElement2("A", []);
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 runJUnitTest(__test, __test.test_getSuperclass_parameterized); 1744 runJUnitTest(__test, __test.test_getSuperclass_parameterized);
1731 }); 1745 });
1732 _ut.test('test_getTypeArguments_empty', () { 1746 _ut.test('test_getTypeArguments_empty', () {
1733 final __test = new InterfaceTypeImplTest(); 1747 final __test = new InterfaceTypeImplTest();
1734 runJUnitTest(__test, __test.test_getTypeArguments_empty); 1748 runJUnitTest(__test, __test.test_getTypeArguments_empty);
1735 }); 1749 });
1736 _ut.test('test_hashCode', () { 1750 _ut.test('test_hashCode', () {
1737 final __test = new InterfaceTypeImplTest(); 1751 final __test = new InterfaceTypeImplTest();
1738 runJUnitTest(__test, __test.test_hashCode); 1752 runJUnitTest(__test, __test.test_hashCode);
1739 }); 1753 });
1754 _ut.test('test_isAssignableTo_typeVariables', () {
1755 final __test = new InterfaceTypeImplTest();
1756 runJUnitTest(__test, __test.test_isAssignableTo_typeVariables);
1757 });
1758 _ut.test('test_isAssignableTo_void', () {
1759 final __test = new InterfaceTypeImplTest();
1760 runJUnitTest(__test, __test.test_isAssignableTo_void);
1761 });
1740 _ut.test('test_isDirectSupertypeOf_extends', () { 1762 _ut.test('test_isDirectSupertypeOf_extends', () {
1741 final __test = new InterfaceTypeImplTest(); 1763 final __test = new InterfaceTypeImplTest();
1742 runJUnitTest(__test, __test.test_isDirectSupertypeOf_extends); 1764 runJUnitTest(__test, __test.test_isDirectSupertypeOf_extends);
1743 }); 1765 });
1744 _ut.test('test_isDirectSupertypeOf_false', () { 1766 _ut.test('test_isDirectSupertypeOf_false', () {
1745 final __test = new InterfaceTypeImplTest(); 1767 final __test = new InterfaceTypeImplTest();
1746 runJUnitTest(__test, __test.test_isDirectSupertypeOf_false); 1768 runJUnitTest(__test, __test.test_isDirectSupertypeOf_false);
1747 }); 1769 });
1748 _ut.test('test_isDirectSupertypeOf_implements', () { 1770 _ut.test('test_isDirectSupertypeOf_implements', () {
1749 final __test = new InterfaceTypeImplTest(); 1771 final __test = new InterfaceTypeImplTest();
(...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after
2784 FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [ a]).type; 2806 FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [ a]).type;
2785 FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).ty pe; 2807 FunctionType s = ElementFactory.functionElement5("s", <ClassElement> [a]).ty pe;
2786 JUnitTestCase.assertTrue(t.isSubtypeOf(s)); 2808 JUnitTestCase.assertTrue(t.isSubtypeOf(s));
2787 JUnitTestCase.assertFalse(s.isSubtypeOf(t)); 2809 JUnitTestCase.assertFalse(s.isSubtypeOf(t));
2788 JUnitTestCase.assertTrue(t.isAssignableTo(s)); 2810 JUnitTestCase.assertTrue(t.isAssignableTo(s));
2789 JUnitTestCase.assertFalse(s.isAssignableTo(t)); 2811 JUnitTestCase.assertFalse(s.isAssignableTo(t));
2790 } 2812 }
2791 2813
2792 void test_isSubtypeOf_baseCase_classFunction() { 2814 void test_isSubtypeOf_baseCase_classFunction() {
2793 ClassElementImpl functionElement = ElementFactory.classElement2("Function", []); 2815 ClassElementImpl functionElement = ElementFactory.classElement2("Function", []);
2794 InterfaceTypeImpl functionType = new InterfaceTypeImpl_24(functionElement); 2816 InterfaceTypeImpl functionType = new InterfaceTypeImpl_25(functionElement);
2795 FunctionType f = ElementFactory.functionElement("f").type; 2817 FunctionType f = ElementFactory.functionElement("f").type;
2796 JUnitTestCase.assertTrue(f.isSubtypeOf(functionType)); 2818 JUnitTestCase.assertTrue(f.isSubtypeOf(functionType));
2797 } 2819 }
2798 2820
2799 void test_isSubtypeOf_baseCase_notFunctionType() { 2821 void test_isSubtypeOf_baseCase_notFunctionType() {
2800 FunctionType f = ElementFactory.functionElement("f").type; 2822 FunctionType f = ElementFactory.functionElement("f").type;
2801 InterfaceType t = ElementFactory.classElement2("C", []).type; 2823 InterfaceType t = ElementFactory.classElement2("C", []).type;
2802 JUnitTestCase.assertFalse(f.isSubtypeOf(t)); 2824 JUnitTestCase.assertFalse(f.isSubtypeOf(t));
2803 } 2825 }
2804 2826
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 runJUnitTest(__test, __test.test_substitute2_equal); 3305 runJUnitTest(__test, __test.test_substitute2_equal);
3284 }); 3306 });
3285 _ut.test('test_substitute2_notEqual', () { 3307 _ut.test('test_substitute2_notEqual', () {
3286 final __test = new FunctionTypeImplTest(); 3308 final __test = new FunctionTypeImplTest();
3287 runJUnitTest(__test, __test.test_substitute2_notEqual); 3309 runJUnitTest(__test, __test.test_substitute2_notEqual);
3288 }); 3310 });
3289 }); 3311 });
3290 } 3312 }
3291 } 3313 }
3292 3314
3293 class InterfaceTypeImpl_24 extends InterfaceTypeImpl { 3315 class InterfaceTypeImpl_25 extends InterfaceTypeImpl {
3294 InterfaceTypeImpl_24(ClassElement arg0) : super.con1(arg0); 3316 InterfaceTypeImpl_25(ClassElement arg0) : super.con1(arg0);
3295 3317
3296 bool get isDartCoreFunction => true; 3318 bool get isDartCoreFunction => true;
3297 } 3319 }
3298 3320
3299 main() { 3321 main() {
3300 ElementKindTest.dartSuite(); 3322 ElementKindTest.dartSuite();
3301 FunctionTypeImplTest.dartSuite(); 3323 FunctionTypeImplTest.dartSuite();
3302 InterfaceTypeImplTest.dartSuite(); 3324 InterfaceTypeImplTest.dartSuite();
3303 TypeParameterTypeImplTest.dartSuite(); 3325 TypeParameterTypeImplTest.dartSuite();
3304 VoidTypeImplTest.dartSuite(); 3326 VoidTypeImplTest.dartSuite();
3305 ClassElementImplTest.dartSuite(); 3327 ClassElementImplTest.dartSuite();
3306 ElementLocationImplTest.dartSuite(); 3328 ElementLocationImplTest.dartSuite();
3307 ElementImplTest.dartSuite(); 3329 ElementImplTest.dartSuite();
3308 LibraryElementImplTest.dartSuite(); 3330 LibraryElementImplTest.dartSuite();
3309 MultiplyDefinedElementImplTest.dartSuite(); 3331 MultiplyDefinedElementImplTest.dartSuite();
3310 } 3332 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/ast_test.dart ('k') | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698