| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library analyzer.test.generated.inheritance_manager_test; | 5 library analyzer.test.generated.inheritance_manager_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1279 classC.methods = <MethodElement>[methodMinC]; | 1279 classC.methods = <MethodElement>[methodMinC]; |
| 1280 List<ExecutableElement> overrides = | 1280 List<ExecutableElement> overrides = |
| 1281 _inheritanceManager.lookupOverrides(classC, methodName); | 1281 _inheritanceManager.lookupOverrides(classC, methodName); |
| 1282 expect(overrides, unorderedEquals([methodMinA, methodMinB])); | 1282 expect(overrides, unorderedEquals([methodMinA, methodMinB])); |
| 1283 _assertNoErrors(classA); | 1283 _assertNoErrors(classA); |
| 1284 _assertNoErrors(classB); | 1284 _assertNoErrors(classB); |
| 1285 _assertNoErrors(classC); | 1285 _assertNoErrors(classC); |
| 1286 } | 1286 } |
| 1287 | 1287 |
| 1288 void _assertErrors(ClassElement classElt, | 1288 void _assertErrors(ClassElement classElt, |
| 1289 [List<ErrorCode> expectedErrorCodes = ErrorCode.EMPTY_LIST]) { | 1289 [List<ErrorCode> expectedErrorCodes = const <ErrorCode>[]]) { |
| 1290 GatheringErrorListener errorListener = new GatheringErrorListener(); | 1290 GatheringErrorListener errorListener = new GatheringErrorListener(); |
| 1291 HashSet<AnalysisError> actualErrors = | 1291 HashSet<AnalysisError> actualErrors = |
| 1292 _inheritanceManager.getErrors(classElt); | 1292 _inheritanceManager.getErrors(classElt); |
| 1293 if (actualErrors != null) { | 1293 if (actualErrors != null) { |
| 1294 for (AnalysisError error in actualErrors) { | 1294 for (AnalysisError error in actualErrors) { |
| 1295 errorListener.onError(error); | 1295 errorListener.onError(error); |
| 1296 } | 1296 } |
| 1297 } | 1297 } |
| 1298 errorListener.assertErrorsWithCodes(expectedErrorCodes); | 1298 errorListener.assertErrorsWithCodes(expectedErrorCodes); |
| 1299 } | 1299 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1314 Source source = new FileSource(resourceProvider.getFile("/test.dart")); | 1314 Source source = new FileSource(resourceProvider.getFile("/test.dart")); |
| 1315 CompilationUnitElementImpl definingCompilationUnit = | 1315 CompilationUnitElementImpl definingCompilationUnit = |
| 1316 new CompilationUnitElementImpl("test.dart"); | 1316 new CompilationUnitElementImpl("test.dart"); |
| 1317 definingCompilationUnit.librarySource = | 1317 definingCompilationUnit.librarySource = |
| 1318 definingCompilationUnit.source = source; | 1318 definingCompilationUnit.source = source; |
| 1319 _definingLibrary = ElementFactory.library(context, "test"); | 1319 _definingLibrary = ElementFactory.library(context, "test"); |
| 1320 _definingLibrary.definingCompilationUnit = definingCompilationUnit; | 1320 _definingLibrary.definingCompilationUnit = definingCompilationUnit; |
| 1321 return new InheritanceManager(_definingLibrary); | 1321 return new InheritanceManager(_definingLibrary); |
| 1322 } | 1322 } |
| 1323 } | 1323 } |
| OLD | NEW |