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

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

Issue 736603005: Rollback r41807. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.element_test; 8 library engine.element_test;
9 9
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 15 matching lines...) Expand all
26 groupSep = ' | '; 26 groupSep = ' | ';
27 runReflectiveTests(AngularPropertyKindTest); 27 runReflectiveTests(AngularPropertyKindTest);
28 runReflectiveTests(ElementKindTest); 28 runReflectiveTests(ElementKindTest);
29 runReflectiveTests(FunctionTypeImplTest); 29 runReflectiveTests(FunctionTypeImplTest);
30 runReflectiveTests(InterfaceTypeImplTest); 30 runReflectiveTests(InterfaceTypeImplTest);
31 runReflectiveTests(TypeParameterTypeImplTest); 31 runReflectiveTests(TypeParameterTypeImplTest);
32 runReflectiveTests(UnionTypeImplTest); 32 runReflectiveTests(UnionTypeImplTest);
33 runReflectiveTests(VoidTypeImplTest); 33 runReflectiveTests(VoidTypeImplTest);
34 runReflectiveTests(ClassElementImplTest); 34 runReflectiveTests(ClassElementImplTest);
35 runReflectiveTests(CompilationUnitElementImplTest); 35 runReflectiveTests(CompilationUnitElementImplTest);
36 runReflectiveTests(ElementLocationImplTest);
36 runReflectiveTests(ElementImplTest); 37 runReflectiveTests(ElementImplTest);
37 runReflectiveTests(HtmlElementImplTest); 38 runReflectiveTests(HtmlElementImplTest);
38 runReflectiveTests(LibraryElementImplTest); 39 runReflectiveTests(LibraryElementImplTest);
39 runReflectiveTests(MultiplyDefinedElementImplTest); 40 runReflectiveTests(MultiplyDefinedElementImplTest);
40 } 41 }
41 42
42 class AngularPropertyKindTest extends EngineTestCase { 43 class AngularPropertyKindTest extends EngineTestCase {
43 void test_ATTR() { 44 void test_ATTR() {
44 AngularPropertyKind kind = AngularPropertyKind.ATTR; 45 AngularPropertyKind kind = AngularPropertyKind.ATTR;
45 expect(kind.callsGetter(), isFalse); 46 expect(kind.callsGetter(), isFalse);
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 expect( 1051 expect(
1051 ElementKind.of(ElementFactory.classElement2("A")), 1052 ElementKind.of(ElementFactory.classElement2("A")),
1052 same(ElementKind.CLASS)); 1053 same(ElementKind.CLASS));
1053 } 1054 }
1054 1055
1055 void test_of_null() { 1056 void test_of_null() {
1056 expect(ElementKind.of(null), same(ElementKind.ERROR)); 1057 expect(ElementKind.of(null), same(ElementKind.ERROR));
1057 } 1058 }
1058 } 1059 }
1059 1060
1061 class ElementLocationImplTest extends EngineTestCase {
1062 void test_create_encoding() {
1063 String encoding = "a;b;c";
1064 ElementLocationImpl location = new ElementLocationImpl.con2(encoding);
1065 expect(location.encoding, encoding);
1066 }
1067
1068 /**
1069 * For example unnamed constructor.
1070 */
1071 void test_create_encoding_emptyLast() {
1072 String encoding = "a;b;c;";
1073 ElementLocationImpl location = new ElementLocationImpl.con2(encoding);
1074 expect(location.encoding, encoding);
1075 }
1076
1077 void test_equals_equal() {
1078 String encoding = "a;b;c";
1079 ElementLocationImpl first = new ElementLocationImpl.con2(encoding);
1080 ElementLocationImpl second = new ElementLocationImpl.con2(encoding);
1081 expect(first == second, isTrue);
1082 }
1083
1084 void test_equals_notEqual_differentLengths() {
1085 ElementLocationImpl first = new ElementLocationImpl.con2("a;b;c");
1086 ElementLocationImpl second = new ElementLocationImpl.con2("a;b;c;d");
1087 expect(first == second, isFalse);
1088 }
1089
1090 void test_equals_notEqual_notLocation() {
1091 ElementLocationImpl first = new ElementLocationImpl.con2("a;b;c");
1092 expect(first == "a;b;d", isFalse);
1093 }
1094
1095 void test_equals_notEqual_sameLengths() {
1096 ElementLocationImpl first = new ElementLocationImpl.con2("a;b;c");
1097 ElementLocationImpl second = new ElementLocationImpl.con2("a;b;d");
1098 expect(first == second, isFalse);
1099 }
1100
1101 void test_getComponents() {
1102 String encoding = "a;b;c";
1103 ElementLocationImpl location = new ElementLocationImpl.con2(encoding);
1104 List<String> components = location.components;
1105 expect(components, hasLength(3));
1106 expect(components[0], "a");
1107 expect(components[1], "b");
1108 expect(components[2], "c");
1109 }
1110
1111 void test_getEncoding() {
1112 String encoding = "a;b;c;;d";
1113 ElementLocationImpl location = new ElementLocationImpl.con2(encoding);
1114 expect(location.encoding, encoding);
1115 }
1116
1117 void test_hashCode_equal() {
1118 String encoding = "a;b;c";
1119 ElementLocationImpl first = new ElementLocationImpl.con2(encoding);
1120 ElementLocationImpl second = new ElementLocationImpl.con2(encoding);
1121 expect(first.hashCode == second.hashCode, isTrue);
1122 }
1123 }
1124
1060 class FunctionTypeImplTest extends EngineTestCase { 1125 class FunctionTypeImplTest extends EngineTestCase {
1061 void test_creation() { 1126 void test_creation() {
1062 expect( 1127 expect(
1063 new FunctionTypeImpl.con1( 1128 new FunctionTypeImpl.con1(
1064 new FunctionElementImpl.forNode(AstFactory.identifier3("f"))), 1129 new FunctionElementImpl.forNode(AstFactory.identifier3("f"))),
1065 isNotNull); 1130 isNotNull);
1066 } 1131 }
1067 1132
1068 void test_getElement() { 1133 void test_getElement() {
1069 FunctionElementImpl typeElement = 1134 FunctionElementImpl typeElement =
(...skipping 2820 matching lines...) Expand 10 before | Expand all | Expand 10 after
3890 3955
3891 class _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction extends 3956 class _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction extends
3892 InterfaceTypeImpl { 3957 InterfaceTypeImpl {
3893 3958
3894 _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(ClassElement arg0) 3959 _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(ClassElement arg0)
3895 : super.con1(arg0); 3960 : super.con1(arg0);
3896 3961
3897 @override 3962 @override
3898 bool get isDartCoreFunction => true; 3963 bool get isDartCoreFunction => true;
3899 } 3964 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/engine.dart ('k') | pkg/analyzer/test/generated/engine_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698