| 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.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'; |
| 11 import 'package:analyzer_experimental/src/generated/ast.dart' hide Annotation; | 11 import 'package:analyzer_experimental/src/generated/ast.dart'; |
| 12 import 'package:analyzer_experimental/src/generated/parser.dart' show ParserErro
rCode; | 12 import 'package:analyzer_experimental/src/generated/parser.dart' show ParserErro
rCode; |
| 13 import 'package:analyzer_experimental/src/generated/element.dart'; | 13 import 'package:analyzer_experimental/src/generated/element.dart'; |
| 14 import 'package:analyzer_experimental/src/generated/resolver.dart'; | 14 import 'package:analyzer_experimental/src/generated/resolver.dart'; |
| 15 import 'package:analyzer_experimental/src/generated/engine.dart'; | 15 import 'package:analyzer_experimental/src/generated/engine.dart'; |
| 16 import 'package:analyzer_experimental/src/generated/java_engine_io.dart'; | 16 import 'package:analyzer_experimental/src/generated/java_engine_io.dart'; |
| 17 import 'package:analyzer_experimental/src/generated/sdk.dart' show DartSdk; | 17 import 'package:analyzer_experimental/src/generated/sdk.dart' show DartSdk; |
| 18 import 'package:analyzer_experimental/src/generated/sdk_io.dart' show DirectoryB
asedDartSdk; | 18 import 'package:analyzer_experimental/src/generated/sdk_io.dart' show DirectoryB
asedDartSdk; |
| 19 import 'package:unittest/unittest.dart' as _ut; | 19 import 'package:unittest/unittest.dart' as _ut; |
| 20 import 'test_support.dart'; | 20 import 'test_support.dart'; |
| 21 import 'ast_test.dart' show ASTFactory; | 21 import 'ast_test.dart' show ASTFactory; |
| (...skipping 3112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3134 */ | 3134 */ |
| 3135 Source addSource(String contents) => addSource2("/test.dart", contents); | 3135 Source addSource(String contents) => addSource2("/test.dart", contents); |
| 3136 | 3136 |
| 3137 /** | 3137 /** |
| 3138 * Add a source file to the content provider. The file path should be absolute
. | 3138 * Add a source file to the content provider. The file path should be absolute
. |
| 3139 * @param filePath the path of the file being added | 3139 * @param filePath the path of the file being added |
| 3140 * @param contents the contents to be returned by the content provider for the
specified file | 3140 * @param contents the contents to be returned by the content provider for the
specified file |
| 3141 * @return the source object representing the added file | 3141 * @return the source object representing the added file |
| 3142 */ | 3142 */ |
| 3143 Source addSource2(String filePath, String contents) { | 3143 Source addSource2(String filePath, String contents) { |
| 3144 Source source = new FileBasedSource.con1(_sourceFactory.contentCache, FileUt
ilities2.createFile(filePath)); | 3144 Source source = cacheSource(filePath, contents); |
| 3145 _sourceFactory.setContents(source, contents); | |
| 3146 ChangeSet changeSet = new ChangeSet(); | 3145 ChangeSet changeSet = new ChangeSet(); |
| 3147 changeSet.added(source); | 3146 changeSet.added(source); |
| 3148 _analysisContext.applyChanges(changeSet); | 3147 _analysisContext.applyChanges(changeSet); |
| 3149 return source; | 3148 return source; |
| 3150 } | 3149 } |
| 3151 | 3150 |
| 3152 /** | 3151 /** |
| 3153 * Assert that the number of errors that have been gathered matches the number
of errors that are | 3152 * Assert that the number of errors that have been gathered matches the number
of errors that are |
| 3154 * given and that they have the expected error codes. The order in which the e
rrors were gathered | 3153 * given and that they have the expected error codes. The order in which the e
rrors were gathered |
| 3155 * is ignored. | 3154 * is ignored. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 3175 GatheringErrorListener errorListener = new GatheringErrorListener(); | 3174 GatheringErrorListener errorListener = new GatheringErrorListener(); |
| 3176 for (ChangeNotice notice in _analysisContext.performAnalysisTask()) { | 3175 for (ChangeNotice notice in _analysisContext.performAnalysisTask()) { |
| 3177 for (AnalysisError error in notice.errors) { | 3176 for (AnalysisError error in notice.errors) { |
| 3178 errorListener.onError(error); | 3177 errorListener.onError(error); |
| 3179 } | 3178 } |
| 3180 } | 3179 } |
| 3181 errorListener.assertNoErrors(); | 3180 errorListener.assertNoErrors(); |
| 3182 } | 3181 } |
| 3183 | 3182 |
| 3184 /** | 3183 /** |
| 3184 * Cache the source file content in the source factory but don't add the sourc
e to the analysis |
| 3185 * context. The file path should be absolute. |
| 3186 * @param filePath the path of the file being cached |
| 3187 * @param contents the contents to be returned by the content provider for the
specified file |
| 3188 * @return the source object representing the cached file |
| 3189 */ |
| 3190 Source cacheSource(String filePath, String contents) { |
| 3191 Source source = new FileBasedSource.con1(_sourceFactory.contentCache, FileUt
ilities2.createFile(filePath)); |
| 3192 _sourceFactory.setContents(source, contents); |
| 3193 return source; |
| 3194 } |
| 3195 |
| 3196 /** |
| 3185 * Create a library element that represents a library named {@code "test"} con
taining a single | 3197 * Create a library element that represents a library named {@code "test"} con
taining a single |
| 3186 * empty compilation unit. | 3198 * empty compilation unit. |
| 3187 * @return the library element that was created | 3199 * @return the library element that was created |
| 3188 */ | 3200 */ |
| 3189 LibraryElementImpl createTestLibrary() => createTestLibrary2(new AnalysisConte
xtImpl(), "test", []); | 3201 LibraryElementImpl createTestLibrary() => createTestLibrary2(new AnalysisConte
xtImpl(), "test", []); |
| 3190 | 3202 |
| 3191 /** | 3203 /** |
| 3192 * Create a library element that represents a library with the given name cont
aining a single | 3204 * Create a library element that represents a library with the given name cont
aining a single |
| 3193 * empty compilation unit. | 3205 * empty compilation unit. |
| 3194 * @param libraryName the name of the library to be created | 3206 * @param libraryName the name of the library to be created |
| (...skipping 4156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7351 runJUnitTest(__test, __test.test_getType_noOverride); | 7363 runJUnitTest(__test, __test.test_getType_noOverride); |
| 7352 }); | 7364 }); |
| 7353 _ut.test('test_getType_noScope', () { | 7365 _ut.test('test_getType_noScope', () { |
| 7354 final __test = new TypeOverrideManagerTest(); | 7366 final __test = new TypeOverrideManagerTest(); |
| 7355 runJUnitTest(__test, __test.test_getType_noScope); | 7367 runJUnitTest(__test, __test.test_getType_noScope); |
| 7356 }); | 7368 }); |
| 7357 }); | 7369 }); |
| 7358 } | 7370 } |
| 7359 } | 7371 } |
| 7360 class PubSuggestionCodeTest extends ResolverTestCase { | 7372 class PubSuggestionCodeTest extends ResolverTestCase { |
| 7373 void test_import_package() { |
| 7374 Source source = addSource(EngineTestCase.createSource(["import 'package:some
package/other.dart';"])); |
| 7375 resolve(source); |
| 7376 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST]); |
| 7377 } |
| 7361 void test_import_packageWithDotDot() { | 7378 void test_import_packageWithDotDot() { |
| 7362 Source source = addSource(EngineTestCase.createSource(["import 'package:some
package/../other.dart';"])); | 7379 Source source = addSource(EngineTestCase.createSource(["import 'package:some
package/../other.dart';"])); |
| 7363 resolve(source); | 7380 resolve(source); |
| 7364 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST, PubSuggestionCode.PAC
KAGE_IMPORT_CONTAINS_DOT_DOT]); | 7381 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST, PubSuggestionCode.PAC
KAGE_IMPORT_CONTAINS_DOT_DOT]); |
| 7365 } | 7382 } |
| 7366 void test_import_packageWithLeadingDotDot() { | 7383 void test_import_packageWithLeadingDotDot() { |
| 7367 Source source = addSource(EngineTestCase.createSource(["import 'package:../o
ther.dart';"])); | 7384 Source source = addSource(EngineTestCase.createSource(["import 'package:../o
ther.dart';"])); |
| 7368 resolve(source); | 7385 resolve(source); |
| 7369 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST, PubSuggestionCode.PAC
KAGE_IMPORT_CONTAINS_DOT_DOT]); | 7386 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST, PubSuggestionCode.PAC
KAGE_IMPORT_CONTAINS_DOT_DOT]); |
| 7370 } | 7387 } |
| 7371 void test_import_referenceIntoLibDirectory() { | 7388 void test_import_referenceIntoLibDirectory() { |
| 7372 Source source = addSource(EngineTestCase.createSource(["import '../lib/other
.dart';"])); | 7389 cacheSource("/myproj/pubspec.yaml", ""); |
| 7390 cacheSource("/myproj/lib/other.dart", ""); |
| 7391 Source source = addSource2("/myproj/web/test.dart", EngineTestCase.createSou
rce(["import '../lib/other.dart';"])); |
| 7373 resolve(source); | 7392 resolve(source); |
| 7374 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST, PubSuggestionCode.FIL
E_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE]); | 7393 assertErrors([PubSuggestionCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSI
DE]); |
| 7394 } |
| 7395 void test_import_referenceIntoLibDirectory_no_pubspec() { |
| 7396 cacheSource("/myproj/lib/other.dart", ""); |
| 7397 Source source = addSource2("/myproj/web/test.dart", EngineTestCase.createSou
rce(["import '../lib/other.dart';"])); |
| 7398 resolve(source); |
| 7399 assertNoErrors(); |
| 7375 } | 7400 } |
| 7376 void test_import_referenceOutOfLibDirectory() { | 7401 void test_import_referenceOutOfLibDirectory() { |
| 7377 Source source = addSource2("lib/test.dart", EngineTestCase.createSource(["im
port '../web/other.dart';"])); | 7402 cacheSource("/myproj/pubspec.yaml", ""); |
| 7403 cacheSource("/myproj/web/other.dart", ""); |
| 7404 Source source = addSource2("/myproj/lib/test.dart", EngineTestCase.createSou
rce(["import '../web/other.dart';"])); |
| 7378 resolve(source); | 7405 resolve(source); |
| 7379 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST, PubSuggestionCode.FIL
E_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE]); | 7406 assertErrors([PubSuggestionCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSI
DE]); |
| 7380 } | 7407 } |
| 7381 void test_import_valid() { | 7408 void test_import_referenceOutOfLibDirectory_no_pubspec() { |
| 7382 Source source = addSource2("lib2/test.dart", EngineTestCase.createSource(["i
mport '../web/other.dart';"])); | 7409 cacheSource("/myproj/web/other.dart", ""); |
| 7410 Source source = addSource2("/myproj/lib/test.dart", EngineTestCase.createSou
rce(["import '../web/other.dart';"])); |
| 7383 resolve(source); | 7411 resolve(source); |
| 7384 assertErrors([CompileTimeErrorCode.URI_DOES_NOT_EXIST]); | 7412 assertNoErrors(); |
| 7413 } |
| 7414 void test_import_valid_inside_lib1() { |
| 7415 cacheSource("/myproj/pubspec.yaml", ""); |
| 7416 cacheSource("/myproj/lib/other.dart", ""); |
| 7417 Source source = addSource2("/myproj/lib/test.dart", EngineTestCase.createSou
rce(["import 'other.dart';"])); |
| 7418 resolve(source); |
| 7419 assertNoErrors(); |
| 7420 } |
| 7421 void test_import_valid_inside_lib2() { |
| 7422 cacheSource("/myproj/pubspec.yaml", ""); |
| 7423 cacheSource("/myproj/lib/bar/other.dart", ""); |
| 7424 Source source = addSource2("/myproj/lib/foo/test.dart", EngineTestCase.creat
eSource(["import '../bar/other.dart';"])); |
| 7425 resolve(source); |
| 7426 assertNoErrors(); |
| 7427 } |
| 7428 void test_import_valid_outside_lib() { |
| 7429 cacheSource("/myproj/pubspec.yaml", ""); |
| 7430 cacheSource("/myproj/web/other.dart", ""); |
| 7431 Source source = addSource2("/myproj/lib2/test.dart", EngineTestCase.createSo
urce(["import '../web/other.dart';"])); |
| 7432 resolve(source); |
| 7433 assertNoErrors(); |
| 7385 } | 7434 } |
| 7386 static dartSuite() { | 7435 static dartSuite() { |
| 7387 _ut.group('PubSuggestionCodeTest', () { | 7436 _ut.group('PubSuggestionCodeTest', () { |
| 7437 _ut.test('test_import_package', () { |
| 7438 final __test = new PubSuggestionCodeTest(); |
| 7439 runJUnitTest(__test, __test.test_import_package); |
| 7440 }); |
| 7388 _ut.test('test_import_packageWithDotDot', () { | 7441 _ut.test('test_import_packageWithDotDot', () { |
| 7389 final __test = new PubSuggestionCodeTest(); | 7442 final __test = new PubSuggestionCodeTest(); |
| 7390 runJUnitTest(__test, __test.test_import_packageWithDotDot); | 7443 runJUnitTest(__test, __test.test_import_packageWithDotDot); |
| 7391 }); | 7444 }); |
| 7392 _ut.test('test_import_packageWithLeadingDotDot', () { | 7445 _ut.test('test_import_packageWithLeadingDotDot', () { |
| 7393 final __test = new PubSuggestionCodeTest(); | 7446 final __test = new PubSuggestionCodeTest(); |
| 7394 runJUnitTest(__test, __test.test_import_packageWithLeadingDotDot); | 7447 runJUnitTest(__test, __test.test_import_packageWithLeadingDotDot); |
| 7395 }); | 7448 }); |
| 7396 _ut.test('test_import_referenceIntoLibDirectory', () { | 7449 _ut.test('test_import_referenceIntoLibDirectory', () { |
| 7397 final __test = new PubSuggestionCodeTest(); | 7450 final __test = new PubSuggestionCodeTest(); |
| 7398 runJUnitTest(__test, __test.test_import_referenceIntoLibDirectory); | 7451 runJUnitTest(__test, __test.test_import_referenceIntoLibDirectory); |
| 7399 }); | 7452 }); |
| 7453 _ut.test('test_import_referenceIntoLibDirectory_no_pubspec', () { |
| 7454 final __test = new PubSuggestionCodeTest(); |
| 7455 runJUnitTest(__test, __test.test_import_referenceIntoLibDirectory_no_pub
spec); |
| 7456 }); |
| 7400 _ut.test('test_import_referenceOutOfLibDirectory', () { | 7457 _ut.test('test_import_referenceOutOfLibDirectory', () { |
| 7401 final __test = new PubSuggestionCodeTest(); | 7458 final __test = new PubSuggestionCodeTest(); |
| 7402 runJUnitTest(__test, __test.test_import_referenceOutOfLibDirectory); | 7459 runJUnitTest(__test, __test.test_import_referenceOutOfLibDirectory); |
| 7403 }); | 7460 }); |
| 7404 _ut.test('test_import_valid', () { | 7461 _ut.test('test_import_referenceOutOfLibDirectory_no_pubspec', () { |
| 7405 final __test = new PubSuggestionCodeTest(); | 7462 final __test = new PubSuggestionCodeTest(); |
| 7406 runJUnitTest(__test, __test.test_import_valid); | 7463 runJUnitTest(__test, __test.test_import_referenceOutOfLibDirectory_no_pu
bspec); |
| 7464 }); |
| 7465 _ut.test('test_import_valid_inside_lib1', () { |
| 7466 final __test = new PubSuggestionCodeTest(); |
| 7467 runJUnitTest(__test, __test.test_import_valid_inside_lib1); |
| 7468 }); |
| 7469 _ut.test('test_import_valid_inside_lib2', () { |
| 7470 final __test = new PubSuggestionCodeTest(); |
| 7471 runJUnitTest(__test, __test.test_import_valid_inside_lib2); |
| 7472 }); |
| 7473 _ut.test('test_import_valid_outside_lib', () { |
| 7474 final __test = new PubSuggestionCodeTest(); |
| 7475 runJUnitTest(__test, __test.test_import_valid_outside_lib); |
| 7407 }); | 7476 }); |
| 7408 }); | 7477 }); |
| 7409 } | 7478 } |
| 7410 } | 7479 } |
| 7411 class StaticWarningCodeTest extends ResolverTestCase { | 7480 class StaticWarningCodeTest extends ResolverTestCase { |
| 7412 void fail_argumentTypeNotAssignable_invocation_functionParameter_generic() { | 7481 void fail_argumentTypeNotAssignable_invocation_functionParameter_generic() { |
| 7413 Source source = addSource(EngineTestCase.createSource(["class A<K, V> {", "
m(f(K k), V v) {", " f(v);", " }", "}"])); | 7482 Source source = addSource(EngineTestCase.createSource(["class A<K, V> {", "
m(f(K k), V v) {", " f(v);", " }", "}"])); |
| 7414 resolve(source); | 7483 resolve(source); |
| 7415 assertErrors([StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); | 7484 assertErrors([StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); |
| 7416 verify([source]); | 7485 verify([source]); |
| (...skipping 3512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10929 verify([source]); | 10998 verify([source]); |
| 10930 } | 10999 } |
| 10931 void test_metadata_class() { | 11000 void test_metadata_class() { |
| 10932 Source source = addSource(EngineTestCase.createSource(["const A = null;", "@
A class C {}"])); | 11001 Source source = addSource(EngineTestCase.createSource(["const A = null;", "@
A class C {}"])); |
| 10933 LibraryElement library = resolve(source); | 11002 LibraryElement library = resolve(source); |
| 10934 JUnitTestCase.assertNotNull(library); | 11003 JUnitTestCase.assertNotNull(library); |
| 10935 CompilationUnitElement unit = library.definingCompilationUnit; | 11004 CompilationUnitElement unit = library.definingCompilationUnit; |
| 10936 JUnitTestCase.assertNotNull(unit); | 11005 JUnitTestCase.assertNotNull(unit); |
| 10937 List<ClassElement> classes = unit.types; | 11006 List<ClassElement> classes = unit.types; |
| 10938 EngineTestCase.assertLength(1, classes); | 11007 EngineTestCase.assertLength(1, classes); |
| 10939 List<Annotation> annotations = classes[0].metadata; | 11008 List<ElementAnnotation> annotations = classes[0].metadata; |
| 10940 EngineTestCase.assertLength(1, annotations); | 11009 EngineTestCase.assertLength(1, annotations); |
| 10941 assertNoErrors(); | 11010 assertNoErrors(); |
| 10942 verify([source]); | 11011 verify([source]); |
| 10943 } | 11012 } |
| 10944 void test_metadata_field() { | 11013 void test_metadata_field() { |
| 10945 Source source = addSource(EngineTestCase.createSource(["const A = null;", "c
lass C {", " @A int f;", "}"])); | 11014 Source source = addSource(EngineTestCase.createSource(["const A = null;", "c
lass C {", " @A int f;", "}"])); |
| 10946 LibraryElement library = resolve(source); | 11015 LibraryElement library = resolve(source); |
| 10947 JUnitTestCase.assertNotNull(library); | 11016 JUnitTestCase.assertNotNull(library); |
| 10948 CompilationUnitElement unit = library.definingCompilationUnit; | 11017 CompilationUnitElement unit = library.definingCompilationUnit; |
| 10949 JUnitTestCase.assertNotNull(unit); | 11018 JUnitTestCase.assertNotNull(unit); |
| 10950 List<ClassElement> classes = unit.types; | 11019 List<ClassElement> classes = unit.types; |
| 10951 EngineTestCase.assertLength(1, classes); | 11020 EngineTestCase.assertLength(1, classes); |
| 10952 FieldElement field = classes[0].fields[0]; | 11021 FieldElement field = classes[0].fields[0]; |
| 10953 List<Annotation> annotations = field.metadata; | 11022 List<ElementAnnotation> annotations = field.metadata; |
| 10954 EngineTestCase.assertLength(1, annotations); | 11023 EngineTestCase.assertLength(1, annotations); |
| 10955 assertNoErrors(); | 11024 assertNoErrors(); |
| 10956 verify([source]); | 11025 verify([source]); |
| 10957 } | 11026 } |
| 10958 void test_metadata_libraryDirective() { | 11027 void test_metadata_libraryDirective() { |
| 10959 Source source = addSource(EngineTestCase.createSource(["@A library lib;", "c
onst A = null;"])); | 11028 Source source = addSource(EngineTestCase.createSource(["@A library lib;", "c
onst A = null;"])); |
| 10960 LibraryElement library = resolve(source); | 11029 LibraryElement library = resolve(source); |
| 10961 JUnitTestCase.assertNotNull(library); | 11030 JUnitTestCase.assertNotNull(library); |
| 10962 List<Annotation> annotations = library.metadata; | 11031 List<ElementAnnotation> annotations = library.metadata; |
| 10963 EngineTestCase.assertLength(1, annotations); | 11032 EngineTestCase.assertLength(1, annotations); |
| 10964 assertNoErrors(); | 11033 assertNoErrors(); |
| 10965 verify([source]); | 11034 verify([source]); |
| 10966 } | 11035 } |
| 10967 void test_metadata_method() { | 11036 void test_metadata_method() { |
| 10968 Source source = addSource(EngineTestCase.createSource(["const A = null;", "c
lass C {", " @A void m() {}", "}"])); | 11037 Source source = addSource(EngineTestCase.createSource(["const A = null;", "c
lass C {", " @A void m() {}", "}"])); |
| 10969 LibraryElement library = resolve(source); | 11038 LibraryElement library = resolve(source); |
| 10970 JUnitTestCase.assertNotNull(library); | 11039 JUnitTestCase.assertNotNull(library); |
| 10971 CompilationUnitElement unit = library.definingCompilationUnit; | 11040 CompilationUnitElement unit = library.definingCompilationUnit; |
| 10972 JUnitTestCase.assertNotNull(unit); | 11041 JUnitTestCase.assertNotNull(unit); |
| 10973 List<ClassElement> classes = unit.types; | 11042 List<ClassElement> classes = unit.types; |
| 10974 EngineTestCase.assertLength(1, classes); | 11043 EngineTestCase.assertLength(1, classes); |
| 10975 MethodElement method = classes[0].methods[0]; | 11044 MethodElement method = classes[0].methods[0]; |
| 10976 List<Annotation> annotations = method.metadata; | 11045 List<ElementAnnotation> annotations = method.metadata; |
| 10977 EngineTestCase.assertLength(1, annotations); | 11046 EngineTestCase.assertLength(1, annotations); |
| 10978 assertNoErrors(); | 11047 assertNoErrors(); |
| 10979 verify([source]); | 11048 verify([source]); |
| 10980 } | 11049 } |
| 10981 void test_method_fromMixin() { | 11050 void test_method_fromMixin() { |
| 10982 Source source = addSource(EngineTestCase.createSource(["class B {", " bar()
=> 1;", "}", "class A {", " foo() => 2;", "}", "", "class C extends B with A {
", " bar() => super.bar();", " foo() => super.foo();", "}"])); | 11051 Source source = addSource(EngineTestCase.createSource(["class B {", " bar()
=> 1;", "}", "class A {", " foo() => 2;", "}", "", "class C extends B with A {
", " bar() => super.bar();", " foo() => super.foo();", "}"])); |
| 10983 resolve(source); | 11052 resolve(source); |
| 10984 assertNoErrors(); | 11053 assertNoErrors(); |
| 10985 verify([source]); | 11054 verify([source]); |
| 10986 } | 11055 } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11264 // CompileTimeErrorCodeTest.dartSuite(); | 11333 // CompileTimeErrorCodeTest.dartSuite(); |
| 11265 // ErrorResolverTest.dartSuite(); | 11334 // ErrorResolverTest.dartSuite(); |
| 11266 // NonErrorResolverTest.dartSuite(); | 11335 // NonErrorResolverTest.dartSuite(); |
| 11267 // PubSuggestionCodeTest.dartSuite(); | 11336 // PubSuggestionCodeTest.dartSuite(); |
| 11268 // SimpleResolverTest.dartSuite(); | 11337 // SimpleResolverTest.dartSuite(); |
| 11269 // StaticTypeWarningCodeTest.dartSuite(); | 11338 // StaticTypeWarningCodeTest.dartSuite(); |
| 11270 // StaticWarningCodeTest.dartSuite(); | 11339 // StaticWarningCodeTest.dartSuite(); |
| 11271 // StrictModeTest.dartSuite(); | 11340 // StrictModeTest.dartSuite(); |
| 11272 // TypePropagationTest.dartSuite(); | 11341 // TypePropagationTest.dartSuite(); |
| 11273 } | 11342 } |
| OLD | NEW |