| 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 library engine.element_test; | 3 library engine.element_test; |
| 4 import 'dart:collection'; | 4 import 'dart:collection'; |
| 5 import 'dart:io'; | 5 import 'dart:io'; |
| 6 import 'package:analyzer_experimental/src/generated/java_core.dart'; | 6 import 'package:analyzer_experimental/src/generated/java_core.dart'; |
| 7 import 'package:analyzer_experimental/src/generated/java_engine.dart'; | 7 import 'package:analyzer_experimental/src/generated/java_engine.dart'; |
| 8 import 'package:analyzer_experimental/src/generated/java_engine_io.dart'; | 8 import 'package:analyzer_experimental/src/generated/java_engine_io.dart'; |
| 9 import 'package:analyzer_experimental/src/generated/java_junit.dart'; | 9 import 'package:analyzer_experimental/src/generated/java_junit.dart'; |
| 10 import 'package:analyzer_experimental/src/generated/source_io.dart'; | 10 import 'package:analyzer_experimental/src/generated/source_io.dart'; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 String encoding = "a;b;c"; | 24 String encoding = "a;b;c"; |
| 25 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); | 25 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); |
| 26 JUnitTestCase.assertEquals(encoding, location.encoding); | 26 JUnitTestCase.assertEquals(encoding, location.encoding); |
| 27 } | 27 } |
| 28 void test_equals_equal() { | 28 void test_equals_equal() { |
| 29 String encoding = "a;b;c"; | 29 String encoding = "a;b;c"; |
| 30 ElementLocationImpl first = new ElementLocationImpl.con2(encoding); | 30 ElementLocationImpl first = new ElementLocationImpl.con2(encoding); |
| 31 ElementLocationImpl second = new ElementLocationImpl.con2(encoding); | 31 ElementLocationImpl second = new ElementLocationImpl.con2(encoding); |
| 32 JUnitTestCase.assertTrue(first == second); | 32 JUnitTestCase.assertTrue(first == second); |
| 33 } | 33 } |
| 34 void test_equals_equalWithDifferentUriKind() { |
| 35 ElementLocationImpl first = new ElementLocationImpl.con2("fa;fb;c"); |
| 36 ElementLocationImpl second = new ElementLocationImpl.con2("pa;pb;c"); |
| 37 JUnitTestCase.assertTrue(first == second); |
| 38 } |
| 34 void test_equals_notEqual_differentLengths() { | 39 void test_equals_notEqual_differentLengths() { |
| 35 ElementLocationImpl first = new ElementLocationImpl.con2("a;b;c"); | 40 ElementLocationImpl first = new ElementLocationImpl.con2("a;b;c"); |
| 36 ElementLocationImpl second = new ElementLocationImpl.con2("a;b;c;d"); | 41 ElementLocationImpl second = new ElementLocationImpl.con2("a;b;c;d"); |
| 37 JUnitTestCase.assertFalse(first == second); | 42 JUnitTestCase.assertFalse(first == second); |
| 38 } | 43 } |
| 39 void test_equals_notEqual_notLocation() { | 44 void test_equals_notEqual_notLocation() { |
| 40 ElementLocationImpl first = new ElementLocationImpl.con2("a;b;c"); | 45 ElementLocationImpl first = new ElementLocationImpl.con2("a;b;c"); |
| 41 JUnitTestCase.assertFalse(first == "a;b;d"); | 46 JUnitTestCase.assertFalse(first == "a;b;d"); |
| 42 } | 47 } |
| 43 void test_equals_notEqual_sameLengths() { | 48 void test_equals_notEqual_sameLengths() { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 62 static dartSuite() { | 67 static dartSuite() { |
| 63 _ut.group('ElementLocationImplTest', () { | 68 _ut.group('ElementLocationImplTest', () { |
| 64 _ut.test('test_create_encoding', () { | 69 _ut.test('test_create_encoding', () { |
| 65 final __test = new ElementLocationImplTest(); | 70 final __test = new ElementLocationImplTest(); |
| 66 runJUnitTest(__test, __test.test_create_encoding); | 71 runJUnitTest(__test, __test.test_create_encoding); |
| 67 }); | 72 }); |
| 68 _ut.test('test_equals_equal', () { | 73 _ut.test('test_equals_equal', () { |
| 69 final __test = new ElementLocationImplTest(); | 74 final __test = new ElementLocationImplTest(); |
| 70 runJUnitTest(__test, __test.test_equals_equal); | 75 runJUnitTest(__test, __test.test_equals_equal); |
| 71 }); | 76 }); |
| 77 _ut.test('test_equals_equalWithDifferentUriKind', () { |
| 78 final __test = new ElementLocationImplTest(); |
| 79 runJUnitTest(__test, __test.test_equals_equalWithDifferentUriKind); |
| 80 }); |
| 72 _ut.test('test_equals_notEqual_differentLengths', () { | 81 _ut.test('test_equals_notEqual_differentLengths', () { |
| 73 final __test = new ElementLocationImplTest(); | 82 final __test = new ElementLocationImplTest(); |
| 74 runJUnitTest(__test, __test.test_equals_notEqual_differentLengths); | 83 runJUnitTest(__test, __test.test_equals_notEqual_differentLengths); |
| 75 }); | 84 }); |
| 76 _ut.test('test_equals_notEqual_notLocation', () { | 85 _ut.test('test_equals_notEqual_notLocation', () { |
| 77 final __test = new ElementLocationImplTest(); | 86 final __test = new ElementLocationImplTest(); |
| 78 runJUnitTest(__test, __test.test_equals_notEqual_notLocation); | 87 runJUnitTest(__test, __test.test_equals_notEqual_notLocation); |
| 79 }); | 88 }); |
| 80 _ut.test('test_equals_notEqual_sameLengths', () { | 89 _ut.test('test_equals_notEqual_sameLengths', () { |
| 81 final __test = new ElementLocationImplTest(); | 90 final __test = new ElementLocationImplTest(); |
| (...skipping 2311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2393 FunctionType t = ElementFactory.functionElement2("t", a).type; | 2402 FunctionType t = ElementFactory.functionElement2("t", a).type; |
| 2394 FunctionType s = ElementFactory.functionElement2("s", b).type; | 2403 FunctionType s = ElementFactory.functionElement2("s", b).type; |
| 2395 JUnitTestCase.assertTrue(t.isSubtypeOf(s)); | 2404 JUnitTestCase.assertTrue(t.isSubtypeOf(s)); |
| 2396 JUnitTestCase.assertTrue(s.isSubtypeOf(t)); | 2405 JUnitTestCase.assertTrue(s.isSubtypeOf(t)); |
| 2397 } | 2406 } |
| 2398 void test_isSubtypeOf_returnType_tNotAssignableToS() { | 2407 void test_isSubtypeOf_returnType_tNotAssignableToS() { |
| 2399 FunctionType t = ElementFactory.functionElement2("t", ElementFactory.classEl
ement2("A", [])).type; | 2408 FunctionType t = ElementFactory.functionElement2("t", ElementFactory.classEl
ement2("A", [])).type; |
| 2400 FunctionType s = ElementFactory.functionElement2("s", ElementFactory.classEl
ement2("B", [])).type; | 2409 FunctionType s = ElementFactory.functionElement2("s", ElementFactory.classEl
ement2("B", [])).type; |
| 2401 JUnitTestCase.assertFalse(t.isSubtypeOf(s)); | 2410 JUnitTestCase.assertFalse(t.isSubtypeOf(s)); |
| 2402 } | 2411 } |
| 2412 void test_isSubtypeOf_typeParameters_matchesBounds() { |
| 2413 TestTypeProvider provider = new TestTypeProvider(); |
| 2414 InterfaceType boolType = provider.boolType; |
| 2415 InterfaceType stringType = provider.stringType; |
| 2416 TypeVariableElementImpl variableB = new TypeVariableElementImpl(ASTFactory.i
dentifier3("B")); |
| 2417 variableB.bound = boolType; |
| 2418 TypeVariableTypeImpl typeB = new TypeVariableTypeImpl(variableB); |
| 2419 TypeVariableElementImpl variableS = new TypeVariableElementImpl(ASTFactory.i
dentifier3("S")); |
| 2420 variableS.bound = stringType; |
| 2421 TypeVariableTypeImpl typeS = new TypeVariableTypeImpl(variableS); |
| 2422 FunctionElementImpl functionAliasElement = new FunctionElementImpl.con1(ASTF
actory.identifier3("func")); |
| 2423 FunctionTypeImpl functionAliasType = new FunctionTypeImpl.con1(functionAlias
Element); |
| 2424 functionAliasElement.type = functionAliasType; |
| 2425 functionAliasType.returnType = stringType; |
| 2426 functionAliasType.normalParameterTypes = <Type2> [typeB]; |
| 2427 functionAliasType.optionalParameterTypes = <Type2> [typeS]; |
| 2428 FunctionElementImpl functionElement = new FunctionElementImpl.con1(ASTFactor
y.identifier3("f")); |
| 2429 FunctionTypeImpl functionType = new FunctionTypeImpl.con1(functionElement); |
| 2430 functionElement.type = functionType; |
| 2431 functionType.returnType = provider.dynamicType; |
| 2432 functionType.normalParameterTypes = <Type2> [boolType]; |
| 2433 functionType.optionalParameterTypes = <Type2> [stringType]; |
| 2434 JUnitTestCase.assertTrue(functionType.isAssignableTo(functionAliasType)); |
| 2435 } |
| 2403 void test_isSubtypeOf_wrongFunctionType_normal_named() { | 2436 void test_isSubtypeOf_wrongFunctionType_normal_named() { |
| 2404 ClassElement a = ElementFactory.classElement2("A", []); | 2437 ClassElement a = ElementFactory.classElement2("A", []); |
| 2405 FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).ty
pe; | 2438 FunctionType t = ElementFactory.functionElement5("t", <ClassElement> [a]).ty
pe; |
| 2406 FunctionType s = ElementFactory.functionElement7("s", null, <String> ["name"
], <ClassElement> [a]).type; | 2439 FunctionType s = ElementFactory.functionElement7("s", null, <String> ["name"
], <ClassElement> [a]).type; |
| 2407 JUnitTestCase.assertFalse(t.isSubtypeOf(s)); | 2440 JUnitTestCase.assertFalse(t.isSubtypeOf(s)); |
| 2408 JUnitTestCase.assertFalse(s.isSubtypeOf(t)); | 2441 JUnitTestCase.assertFalse(s.isSubtypeOf(t)); |
| 2409 } | 2442 } |
| 2410 void test_isSubtypeOf_wrongFunctionType_optional_named() { | 2443 void test_isSubtypeOf_wrongFunctionType_optional_named() { |
| 2411 ClassElement a = ElementFactory.classElement2("A", []); | 2444 ClassElement a = ElementFactory.classElement2("A", []); |
| 2412 FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [
a]).type; | 2445 FunctionType t = ElementFactory.functionElement6("t", null, <ClassElement> [
a]).type; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2633 runJUnitTest(__test, __test.test_isSubtypeOf_returnType_sIsVoid); | 2666 runJUnitTest(__test, __test.test_isSubtypeOf_returnType_sIsVoid); |
| 2634 }); | 2667 }); |
| 2635 _ut.test('test_isSubtypeOf_returnType_tAssignableToS', () { | 2668 _ut.test('test_isSubtypeOf_returnType_tAssignableToS', () { |
| 2636 final __test = new FunctionTypeImplTest(); | 2669 final __test = new FunctionTypeImplTest(); |
| 2637 runJUnitTest(__test, __test.test_isSubtypeOf_returnType_tAssignableToS); | 2670 runJUnitTest(__test, __test.test_isSubtypeOf_returnType_tAssignableToS); |
| 2638 }); | 2671 }); |
| 2639 _ut.test('test_isSubtypeOf_returnType_tNotAssignableToS', () { | 2672 _ut.test('test_isSubtypeOf_returnType_tNotAssignableToS', () { |
| 2640 final __test = new FunctionTypeImplTest(); | 2673 final __test = new FunctionTypeImplTest(); |
| 2641 runJUnitTest(__test, __test.test_isSubtypeOf_returnType_tNotAssignableTo
S); | 2674 runJUnitTest(__test, __test.test_isSubtypeOf_returnType_tNotAssignableTo
S); |
| 2642 }); | 2675 }); |
| 2676 _ut.test('test_isSubtypeOf_typeParameters_matchesBounds', () { |
| 2677 final __test = new FunctionTypeImplTest(); |
| 2678 runJUnitTest(__test, __test.test_isSubtypeOf_typeParameters_matchesBound
s); |
| 2679 }); |
| 2643 _ut.test('test_isSubtypeOf_wrongFunctionType_normal_named', () { | 2680 _ut.test('test_isSubtypeOf_wrongFunctionType_normal_named', () { |
| 2644 final __test = new FunctionTypeImplTest(); | 2681 final __test = new FunctionTypeImplTest(); |
| 2645 runJUnitTest(__test, __test.test_isSubtypeOf_wrongFunctionType_normal_na
med); | 2682 runJUnitTest(__test, __test.test_isSubtypeOf_wrongFunctionType_normal_na
med); |
| 2646 }); | 2683 }); |
| 2647 _ut.test('test_isSubtypeOf_wrongFunctionType_optional_named', () { | 2684 _ut.test('test_isSubtypeOf_wrongFunctionType_optional_named', () { |
| 2648 final __test = new FunctionTypeImplTest(); | 2685 final __test = new FunctionTypeImplTest(); |
| 2649 runJUnitTest(__test, __test.test_isSubtypeOf_wrongFunctionType_optional_
named); | 2686 runJUnitTest(__test, __test.test_isSubtypeOf_wrongFunctionType_optional_
named); |
| 2650 }); | 2687 }); |
| 2651 _ut.test('test_setNamedParameterTypes', () { | 2688 _ut.test('test_setNamedParameterTypes', () { |
| 2652 final __test = new FunctionTypeImplTest(); | 2689 final __test = new FunctionTypeImplTest(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 2682 main() { | 2719 main() { |
| 2683 ElementKindTest.dartSuite(); | 2720 ElementKindTest.dartSuite(); |
| 2684 FunctionTypeImplTest.dartSuite(); | 2721 FunctionTypeImplTest.dartSuite(); |
| 2685 InterfaceTypeImplTest.dartSuite(); | 2722 InterfaceTypeImplTest.dartSuite(); |
| 2686 TypeVariableTypeImplTest.dartSuite(); | 2723 TypeVariableTypeImplTest.dartSuite(); |
| 2687 ClassElementImplTest.dartSuite(); | 2724 ClassElementImplTest.dartSuite(); |
| 2688 ElementLocationImplTest.dartSuite(); | 2725 ElementLocationImplTest.dartSuite(); |
| 2689 ElementImplTest.dartSuite(); | 2726 ElementImplTest.dartSuite(); |
| 2690 LibraryElementImplTest.dartSuite(); | 2727 LibraryElementImplTest.dartSuite(); |
| 2691 } | 2728 } |
| OLD | NEW |