| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 EngineTestCase.assertLength(3, components); | 57 EngineTestCase.assertLength(3, components); |
| 58 JUnitTestCase.assertEquals("a", components[0]); | 58 JUnitTestCase.assertEquals("a", components[0]); |
| 59 JUnitTestCase.assertEquals("b", components[1]); | 59 JUnitTestCase.assertEquals("b", components[1]); |
| 60 JUnitTestCase.assertEquals("c", components[2]); | 60 JUnitTestCase.assertEquals("c", components[2]); |
| 61 } | 61 } |
| 62 void test_getEncoding() { | 62 void test_getEncoding() { |
| 63 String encoding = "a;b;c;;d"; | 63 String encoding = "a;b;c;;d"; |
| 64 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); | 64 ElementLocationImpl location = new ElementLocationImpl.con2(encoding); |
| 65 JUnitTestCase.assertEquals(encoding, location.encoding); | 65 JUnitTestCase.assertEquals(encoding, location.encoding); |
| 66 } | 66 } |
| 67 void test_hashCode_equal() { |
| 68 String encoding = "a;b;c"; |
| 69 ElementLocationImpl first = new ElementLocationImpl.con2(encoding); |
| 70 ElementLocationImpl second = new ElementLocationImpl.con2(encoding); |
| 71 JUnitTestCase.assertTrue(first.hashCode == second.hashCode); |
| 72 } |
| 73 void test_hashCode_equalWithDifferentUriKind() { |
| 74 ElementLocationImpl first = new ElementLocationImpl.con2("fa;fb;c"); |
| 75 ElementLocationImpl second = new ElementLocationImpl.con2("pa;pb;c"); |
| 76 JUnitTestCase.assertTrue(first.hashCode == second.hashCode); |
| 77 } |
| 67 static dartSuite() { | 78 static dartSuite() { |
| 68 _ut.group('ElementLocationImplTest', () { | 79 _ut.group('ElementLocationImplTest', () { |
| 69 _ut.test('test_create_encoding', () { | 80 _ut.test('test_create_encoding', () { |
| 70 final __test = new ElementLocationImplTest(); | 81 final __test = new ElementLocationImplTest(); |
| 71 runJUnitTest(__test, __test.test_create_encoding); | 82 runJUnitTest(__test, __test.test_create_encoding); |
| 72 }); | 83 }); |
| 73 _ut.test('test_equals_equal', () { | 84 _ut.test('test_equals_equal', () { |
| 74 final __test = new ElementLocationImplTest(); | 85 final __test = new ElementLocationImplTest(); |
| 75 runJUnitTest(__test, __test.test_equals_equal); | 86 runJUnitTest(__test, __test.test_equals_equal); |
| 76 }); | 87 }); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 91 runJUnitTest(__test, __test.test_equals_notEqual_sameLengths); | 102 runJUnitTest(__test, __test.test_equals_notEqual_sameLengths); |
| 92 }); | 103 }); |
| 93 _ut.test('test_getComponents', () { | 104 _ut.test('test_getComponents', () { |
| 94 final __test = new ElementLocationImplTest(); | 105 final __test = new ElementLocationImplTest(); |
| 95 runJUnitTest(__test, __test.test_getComponents); | 106 runJUnitTest(__test, __test.test_getComponents); |
| 96 }); | 107 }); |
| 97 _ut.test('test_getEncoding', () { | 108 _ut.test('test_getEncoding', () { |
| 98 final __test = new ElementLocationImplTest(); | 109 final __test = new ElementLocationImplTest(); |
| 99 runJUnitTest(__test, __test.test_getEncoding); | 110 runJUnitTest(__test, __test.test_getEncoding); |
| 100 }); | 111 }); |
| 112 _ut.test('test_hashCode_equal', () { |
| 113 final __test = new ElementLocationImplTest(); |
| 114 runJUnitTest(__test, __test.test_hashCode_equal); |
| 115 }); |
| 116 _ut.test('test_hashCode_equalWithDifferentUriKind', () { |
| 117 final __test = new ElementLocationImplTest(); |
| 118 runJUnitTest(__test, __test.test_hashCode_equalWithDifferentUriKind); |
| 119 }); |
| 101 }); | 120 }); |
| 102 } | 121 } |
| 103 } | 122 } |
| 104 class LibraryElementImplTest extends EngineTestCase { | 123 class LibraryElementImplTest extends EngineTestCase { |
| 105 void test_creation() { | 124 void test_creation() { |
| 106 JUnitTestCase.assertNotNull(new LibraryElementImpl(createAnalysisContext(),
ASTFactory.libraryIdentifier2(["l"]))); | 125 JUnitTestCase.assertNotNull(new LibraryElementImpl(createAnalysisContext(),
ASTFactory.libraryIdentifier2(["l"]))); |
| 107 } | 126 } |
| 108 void test_getImportedLibraries() { | 127 void test_getImportedLibraries() { |
| 109 AnalysisContext context = createAnalysisContext(); | 128 AnalysisContext context = createAnalysisContext(); |
| 110 LibraryElementImpl library1 = ElementFactory.library(context, "l1"); | 129 LibraryElementImpl library1 = ElementFactory.library(context, "l1"); |
| (...skipping 2221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2332 void test_hashCode_element() { | 2351 void test_hashCode_element() { |
| 2333 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier3("f"))); | 2352 FunctionTypeImpl type = new FunctionTypeImpl.con1(new FunctionElementImpl.co
n1(ASTFactory.identifier3("f"))); |
| 2334 type.hashCode; | 2353 type.hashCode; |
| 2335 } | 2354 } |
| 2336 void test_hashCode_noElement() { | 2355 void test_hashCode_noElement() { |
| 2337 FunctionTypeImpl type = new FunctionTypeImpl.con1((null as ExecutableElement
)); | 2356 FunctionTypeImpl type = new FunctionTypeImpl.con1((null as ExecutableElement
)); |
| 2338 type.hashCode; | 2357 type.hashCode; |
| 2339 } | 2358 } |
| 2340 void test_isSubtypeOf_baseCase_classFunction() { | 2359 void test_isSubtypeOf_baseCase_classFunction() { |
| 2341 ClassElementImpl functionElement = ElementFactory.classElement2("Function",
[]); | 2360 ClassElementImpl functionElement = ElementFactory.classElement2("Function",
[]); |
| 2342 InterfaceTypeImpl functionType = new InterfaceTypeImpl_20(functionElement); | 2361 InterfaceTypeImpl functionType = new InterfaceTypeImpl_21(functionElement); |
| 2343 FunctionType f = ElementFactory.functionElement("f").type; | 2362 FunctionType f = ElementFactory.functionElement("f").type; |
| 2344 JUnitTestCase.assertTrue(f.isSubtypeOf(functionType)); | 2363 JUnitTestCase.assertTrue(f.isSubtypeOf(functionType)); |
| 2345 } | 2364 } |
| 2346 void test_isSubtypeOf_baseCase_notFunctionType() { | 2365 void test_isSubtypeOf_baseCase_notFunctionType() { |
| 2347 FunctionType f = ElementFactory.functionElement("f").type; | 2366 FunctionType f = ElementFactory.functionElement("f").type; |
| 2348 InterfaceType t = ElementFactory.classElement2("C", []).type; | 2367 InterfaceType t = ElementFactory.classElement2("C", []).type; |
| 2349 JUnitTestCase.assertFalse(f.isSubtypeOf(t)); | 2368 JUnitTestCase.assertFalse(f.isSubtypeOf(t)); |
| 2350 } | 2369 } |
| 2351 void test_isSubtypeOf_baseCase_null() { | 2370 void test_isSubtypeOf_baseCase_null() { |
| 2352 FunctionType f = ElementFactory.functionElement("f").type; | 2371 FunctionType f = ElementFactory.functionElement("f").type; |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2792 final __test = new FunctionTypeImplTest(); | 2811 final __test = new FunctionTypeImplTest(); |
| 2793 runJUnitTest(__test, __test.test_substitute2_equal); | 2812 runJUnitTest(__test, __test.test_substitute2_equal); |
| 2794 }); | 2813 }); |
| 2795 _ut.test('test_substitute2_notEqual', () { | 2814 _ut.test('test_substitute2_notEqual', () { |
| 2796 final __test = new FunctionTypeImplTest(); | 2815 final __test = new FunctionTypeImplTest(); |
| 2797 runJUnitTest(__test, __test.test_substitute2_notEqual); | 2816 runJUnitTest(__test, __test.test_substitute2_notEqual); |
| 2798 }); | 2817 }); |
| 2799 }); | 2818 }); |
| 2800 } | 2819 } |
| 2801 } | 2820 } |
| 2802 class InterfaceTypeImpl_20 extends InterfaceTypeImpl { | 2821 class InterfaceTypeImpl_21 extends InterfaceTypeImpl { |
| 2803 InterfaceTypeImpl_20(ClassElement arg0) : super.con1(arg0); | 2822 InterfaceTypeImpl_21(ClassElement arg0) : super.con1(arg0); |
| 2804 bool get isDartCoreFunction => true; | 2823 bool get isDartCoreFunction => true; |
| 2805 } | 2824 } |
| 2806 main() { | 2825 main() { |
| 2807 ElementKindTest.dartSuite(); | 2826 ElementKindTest.dartSuite(); |
| 2808 FunctionTypeImplTest.dartSuite(); | 2827 FunctionTypeImplTest.dartSuite(); |
| 2809 InterfaceTypeImplTest.dartSuite(); | 2828 InterfaceTypeImplTest.dartSuite(); |
| 2810 TypeVariableTypeImplTest.dartSuite(); | 2829 TypeVariableTypeImplTest.dartSuite(); |
| 2811 ClassElementImplTest.dartSuite(); | 2830 ClassElementImplTest.dartSuite(); |
| 2812 ElementLocationImplTest.dartSuite(); | 2831 ElementLocationImplTest.dartSuite(); |
| 2813 ElementImplTest.dartSuite(); | 2832 ElementImplTest.dartSuite(); |
| 2814 LibraryElementImplTest.dartSuite(); | 2833 LibraryElementImplTest.dartSuite(); |
| 2815 } | 2834 } |
| OLD | NEW |