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

Side by Side Diff: pkg/analyzer_experimental/test/generated/resolver_test.dart

Issue 18325018: New analyzer_experimental snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months 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 // 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.resolver_test; 3 library engine.resolver_test;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'package:analyzer_experimental/src/generated/java_core.dart'; 5 import 'package:analyzer_experimental/src/generated/java_core.dart';
6 import 'package:analyzer_experimental/src/generated/java_engine.dart'; 6 import 'package:analyzer_experimental/src/generated/java_engine.dart';
7 import 'package:analyzer_experimental/src/generated/java_junit.dart'; 7 import 'package:analyzer_experimental/src/generated/java_junit.dart';
8 import 'package:analyzer_experimental/src/generated/source_io.dart'; 8 import 'package:analyzer_experimental/src/generated/source_io.dart';
9 import 'package:analyzer_experimental/src/generated/error.dart'; 9 import 'package:analyzer_experimental/src/generated/error.dart';
10 import 'package:analyzer_experimental/src/generated/scanner.dart'; 10 import 'package:analyzer_experimental/src/generated/scanner.dart';
(...skipping 5221 matching lines...) Expand 10 before | Expand all | Expand 10 after
5232 Source source1 = addSource2("lib.dart", ""); 5232 Source source1 = addSource2("lib.dart", "");
5233 Source source2 = addSource2("lib2.dart", EngineTestCase.createSource(["impor t 'lib.dart' as lib;", "void f() {", " const lib.A();", "}"])); 5233 Source source2 = addSource2("lib2.dart", EngineTestCase.createSource(["impor t 'lib.dart' as lib;", "void f() {", " const lib.A();", "}"]));
5234 resolve(source1); 5234 resolve(source1);
5235 resolve(source2); 5235 resolve(source2);
5236 assertErrors([CompileTimeErrorCode.CONST_WITH_NON_TYPE]); 5236 assertErrors([CompileTimeErrorCode.CONST_WITH_NON_TYPE]);
5237 verify([source1]); 5237 verify([source1]);
5238 } 5238 }
5239 void test_constWithTypeParameters_direct() { 5239 void test_constWithTypeParameters_direct() {
5240 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " st atic const V = const A<T>();", " const A();", "}"])); 5240 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " st atic const V = const A<T>();", " const A();", "}"]));
5241 resolve(source); 5241 resolve(source);
5242 assertErrors([CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS]); 5242 assertErrors([CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, StaticWarning Code.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
5243 verify([source]); 5243 verify([source]);
5244 } 5244 }
5245 void test_constWithTypeParameters_indirect() { 5245 void test_constWithTypeParameters_indirect() {
5246 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " st atic const V = const A<List<T>>();", " const A();", "}"])); 5246 Source source = addSource(EngineTestCase.createSource(["class A<T> {", " st atic const V = const A<List<T>>();", " const A();", "}"]));
5247 resolve(source); 5247 resolve(source);
5248 assertErrors([CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS]); 5248 assertErrors([CompileTimeErrorCode.CONST_WITH_TYPE_PARAMETERS, StaticWarning Code.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
5249 verify([source]); 5249 verify([source]);
5250 } 5250 }
5251 void test_constWithUndefinedConstructor() { 5251 void test_constWithUndefinedConstructor() {
5252 Source source = addSource(EngineTestCase.createSource(["class A {", " const A();", "}", "f() {", " return const A.noSuchConstructor();", "}"])); 5252 Source source = addSource(EngineTestCase.createSource(["class A {", " const A();", "}", "f() {", " return const A.noSuchConstructor();", "}"]));
5253 resolve(source); 5253 resolve(source);
5254 assertErrors([CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR]); 5254 assertErrors([CompileTimeErrorCode.CONST_WITH_UNDEFINED_CONSTRUCTOR]);
5255 } 5255 }
5256 void test_constWithUndefinedConstructorDefault() { 5256 void test_constWithUndefinedConstructorDefault() {
5257 Source source = addSource(EngineTestCase.createSource(["class A {", " const A.name();", "}", "f() {", " return const A();", "}"])); 5257 Source source = addSource(EngineTestCase.createSource(["class A {", " const A.name();", "}", "f() {", " return const A();", "}"]));
5258 resolve(source); 5258 resolve(source);
(...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after
8205 ExportDirective directive = ASTFactory.exportDirective2(null, []); 8205 ExportDirective directive = ASTFactory.exportDirective2(null, []);
8206 directive.element = ElementFactory.exportFor(ElementFactory.library(_definin gLibrary.context, "lib"), []); 8206 directive.element = ElementFactory.exportFor(ElementFactory.library(_definin gLibrary.context, "lib"), []);
8207 resolveNode(directive, []); 8207 resolveNode(directive, []);
8208 _listener.assertNoErrors(); 8208 _listener.assertNoErrors();
8209 } 8209 }
8210 void test_visitFieldFormalParameter() { 8210 void test_visitFieldFormalParameter() {
8211 InterfaceType intType = _typeProvider.intType; 8211 InterfaceType intType = _typeProvider.intType;
8212 String fieldName = "f"; 8212 String fieldName = "f";
8213 ClassElementImpl classA = ElementFactory.classElement2("A", []); 8213 ClassElementImpl classA = ElementFactory.classElement2("A", []);
8214 classA.fields = <FieldElement> [ElementFactory.fieldElement(fieldName, false , false, false, intType)]; 8214 classA.fields = <FieldElement> [ElementFactory.fieldElement(fieldName, false , false, false, intType)];
8215 FieldFormalParameter parameter = ASTFactory.fieldFormalParameter2(fieldName) ; 8215 FieldFormalParameter parameter = ASTFactory.fieldFormalParameter3(fieldName) ;
8216 parameter.identifier.element = ElementFactory.fieldFormalParameter(parameter .identifier); 8216 parameter.identifier.element = ElementFactory.fieldFormalParameter(parameter .identifier);
8217 resolveInClass(parameter, classA); 8217 resolveInClass(parameter, classA);
8218 JUnitTestCase.assertSame(intType, parameter.element.type); 8218 JUnitTestCase.assertSame(intType, parameter.element.type);
8219 } 8219 }
8220 void test_visitImportDirective_noCombinators_noPrefix() { 8220 void test_visitImportDirective_noCombinators_noPrefix() {
8221 ImportDirective directive = ASTFactory.importDirective2(null, null, []); 8221 ImportDirective directive = ASTFactory.importDirective2(null, null, []);
8222 directive.element = ElementFactory.importFor(ElementFactory.library(_definin gLibrary.context, "lib"), null, []); 8222 directive.element = ElementFactory.importFor(ElementFactory.library(_definin gLibrary.context, "lib"), null, []);
8223 resolveNode(directive, []); 8223 resolveNode(directive, []);
8224 _listener.assertNoErrors(); 8224 _listener.assertNoErrors();
8225 } 8225 }
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
9766 resolve(source); 9766 resolve(source);
9767 assertErrors([StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER]); 9767 assertErrors([StaticWarningCode.STATIC_ACCESS_TO_INSTANCE_MEMBER]);
9768 verify([source]); 9768 verify([source]);
9769 } 9769 }
9770 void test_switchExpressionNotAssignable() { 9770 void test_switchExpressionNotAssignable() {
9771 Source source = addSource(EngineTestCase.createSource(["f(int p) {", " swit ch (p) {", " case 'a': break;", " }", "}"])); 9771 Source source = addSource(EngineTestCase.createSource(["f(int p) {", " swit ch (p) {", " case 'a': break;", " }", "}"]));
9772 resolve(source); 9772 resolve(source);
9773 assertErrors([StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE]); 9773 assertErrors([StaticWarningCode.SWITCH_EXPRESSION_NOT_ASSIGNABLE]);
9774 verify([source]); 9774 verify([source]);
9775 } 9775 }
9776 void test_typeParameterReferencedByStatic_field() {
9777 Source source = addSource(EngineTestCase.createSource(["class A<K> {", " st atic K k;", "}"]));
9778 resolve(source);
9779 assertErrors([StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
9780 verify([source]);
9781 }
9782 void test_typeParameterReferencedByStatic_getter() {
9783 Source source = addSource(EngineTestCase.createSource(["class A<K> {", " st atic K get k => 0;", "}"]));
9784 resolve(source);
9785 assertErrors([StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
9786 verify([source]);
9787 }
9788 void test_typeParameterReferencedByStatic_methodBodyReference() {
9789 Source source = addSource(EngineTestCase.createSource(["class A<K> {", " st atic m() {", " K k;", " }", "}"]));
9790 resolve(source);
9791 assertErrors([StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
9792 verify([source]);
9793 }
9794 void test_typeParameterReferencedByStatic_methodParameter() {
9795 Source source = addSource(EngineTestCase.createSource(["class A<K> {", " st atic m(K k) {}", "}"]));
9796 resolve(source);
9797 assertErrors([StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
9798 verify([source]);
9799 }
9800 void test_typeParameterReferencedByStatic_methodReturn() {
9801 Source source = addSource(EngineTestCase.createSource(["class A<K> {", " st atic K m() {}", "}"]));
9802 resolve(source);
9803 assertErrors([StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
9804 verify([source]);
9805 }
9806 void test_typeParameterReferencedByStatic_setter() {
9807 Source source = addSource(EngineTestCase.createSource(["class A<K> {", " st atic set s(K k) {}", "}"]));
9808 resolve(source);
9809 assertErrors([StaticWarningCode.TYPE_PARAMETER_REFERENCED_BY_STATIC]);
9810 verify([source]);
9811 }
9776 void test_typeTestNonType() { 9812 void test_typeTestNonType() {
9777 Source source = addSource(EngineTestCase.createSource(["var A = 0;", "f(var p) {", " if (p is A) {", " }", "}"])); 9813 Source source = addSource(EngineTestCase.createSource(["var A = 0;", "f(var p) {", " if (p is A) {", " }", "}"]));
9778 resolve(source); 9814 resolve(source);
9779 assertErrors([StaticWarningCode.TYPE_TEST_NON_TYPE]); 9815 assertErrors([StaticWarningCode.TYPE_TEST_NON_TYPE]);
9780 verify([source]); 9816 verify([source]);
9781 } 9817 }
9782 void test_undefinedClass_instanceCreation() { 9818 void test_undefinedClass_instanceCreation() {
9783 Source source = addSource(EngineTestCase.createSource(["f() { new C(); }"])) ; 9819 Source source = addSource(EngineTestCase.createSource(["f() { new C(); }"])) ;
9784 resolve(source); 9820 resolve(source);
9785 assertErrors([StaticWarningCode.UNDEFINED_CLASS]); 9821 assertErrors([StaticWarningCode.UNDEFINED_CLASS]);
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
10289 runJUnitTest(__test, __test.test_staticAccessToInstanceMember_propertyAc cess_getter); 10325 runJUnitTest(__test, __test.test_staticAccessToInstanceMember_propertyAc cess_getter);
10290 }); 10326 });
10291 _ut.test('test_staticAccessToInstanceMember_propertyAccess_setter', () { 10327 _ut.test('test_staticAccessToInstanceMember_propertyAccess_setter', () {
10292 final __test = new StaticWarningCodeTest(); 10328 final __test = new StaticWarningCodeTest();
10293 runJUnitTest(__test, __test.test_staticAccessToInstanceMember_propertyAc cess_setter); 10329 runJUnitTest(__test, __test.test_staticAccessToInstanceMember_propertyAc cess_setter);
10294 }); 10330 });
10295 _ut.test('test_switchExpressionNotAssignable', () { 10331 _ut.test('test_switchExpressionNotAssignable', () {
10296 final __test = new StaticWarningCodeTest(); 10332 final __test = new StaticWarningCodeTest();
10297 runJUnitTest(__test, __test.test_switchExpressionNotAssignable); 10333 runJUnitTest(__test, __test.test_switchExpressionNotAssignable);
10298 }); 10334 });
10335 _ut.test('test_typeParameterReferencedByStatic_field', () {
10336 final __test = new StaticWarningCodeTest();
10337 runJUnitTest(__test, __test.test_typeParameterReferencedByStatic_field);
10338 });
10339 _ut.test('test_typeParameterReferencedByStatic_getter', () {
10340 final __test = new StaticWarningCodeTest();
10341 runJUnitTest(__test, __test.test_typeParameterReferencedByStatic_getter) ;
10342 });
10343 _ut.test('test_typeParameterReferencedByStatic_methodBodyReference', () {
10344 final __test = new StaticWarningCodeTest();
10345 runJUnitTest(__test, __test.test_typeParameterReferencedByStatic_methodB odyReference);
10346 });
10347 _ut.test('test_typeParameterReferencedByStatic_methodParameter', () {
10348 final __test = new StaticWarningCodeTest();
10349 runJUnitTest(__test, __test.test_typeParameterReferencedByStatic_methodP arameter);
10350 });
10351 _ut.test('test_typeParameterReferencedByStatic_methodReturn', () {
10352 final __test = new StaticWarningCodeTest();
10353 runJUnitTest(__test, __test.test_typeParameterReferencedByStatic_methodR eturn);
10354 });
10355 _ut.test('test_typeParameterReferencedByStatic_setter', () {
10356 final __test = new StaticWarningCodeTest();
10357 runJUnitTest(__test, __test.test_typeParameterReferencedByStatic_setter) ;
10358 });
10299 _ut.test('test_typeTestNonType', () { 10359 _ut.test('test_typeTestNonType', () {
10300 final __test = new StaticWarningCodeTest(); 10360 final __test = new StaticWarningCodeTest();
10301 runJUnitTest(__test, __test.test_typeTestNonType); 10361 runJUnitTest(__test, __test.test_typeTestNonType);
10302 }); 10362 });
10303 _ut.test('test_undefinedClassBoolean_variableDeclaration', () { 10363 _ut.test('test_undefinedClassBoolean_variableDeclaration', () {
10304 final __test = new StaticWarningCodeTest(); 10364 final __test = new StaticWarningCodeTest();
10305 runJUnitTest(__test, __test.test_undefinedClassBoolean_variableDeclarati on); 10365 runJUnitTest(__test, __test.test_undefinedClassBoolean_variableDeclarati on);
10306 }); 10366 });
10307 _ut.test('test_undefinedClass_instanceCreation', () { 10367 _ut.test('test_undefinedClass_instanceCreation', () {
10308 final __test = new StaticWarningCodeTest(); 10368 final __test = new StaticWarningCodeTest();
(...skipping 2651 matching lines...) Expand 10 before | Expand all | Expand 10 after
12960 // ErrorResolverTest.dartSuite(); 13020 // ErrorResolverTest.dartSuite();
12961 // HintCodeTest.dartSuite(); 13021 // HintCodeTest.dartSuite();
12962 // NonHintCodeTest.dartSuite(); 13022 // NonHintCodeTest.dartSuite();
12963 // NonErrorResolverTest.dartSuite(); 13023 // NonErrorResolverTest.dartSuite();
12964 // SimpleResolverTest.dartSuite(); 13024 // SimpleResolverTest.dartSuite();
12965 // StaticTypeWarningCodeTest.dartSuite(); 13025 // StaticTypeWarningCodeTest.dartSuite();
12966 // StaticWarningCodeTest.dartSuite(); 13026 // StaticWarningCodeTest.dartSuite();
12967 // StrictModeTest.dartSuite(); 13027 // StrictModeTest.dartSuite();
12968 // TypePropagationTest.dartSuite(); 13028 // TypePropagationTest.dartSuite();
12969 } 13029 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/test/generated/parser_test.dart ('k') | tests/language/language_analyzer2.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698