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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1306323004: Remove obsolete resolution task (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/task/dart_work_manager.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 0489af398dba1de64e6e6c2d553fbf4c87c3a23e..26e240609a9f1089fe4d6c9cc54eb05b49c70567 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -115,8 +115,6 @@ isInstanceOf isResolveFunctionBodiesInUnitTask =
new isInstanceOf<ResolveFunctionBodiesInUnitTask>();
isInstanceOf isResolveLibraryTypeNamesTask =
new isInstanceOf<ResolveLibraryTypeNamesTask>();
-isInstanceOf isResolveUnitReferencesTask =
- new isInstanceOf<ResolveUnitReferencesTask>();
isInstanceOf isResolveUnitTypeNamesTask =
new isInstanceOf<ResolveUnitTypeNamesTask>();
isInstanceOf isResolveVariableReferencesTask =
@@ -2689,92 +2687,6 @@ class B {}
}
@reflectiveTest
-class ResolveUnitReferencesTaskTest extends _AbstractDartTaskTest {
- test_perform() {
- Source source = newSource(
- '/test.dart',
- '''
-class A {
- m() {}
-}
-main(A a) {
- a.m();
-}
-''');
- LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
- // prepare unit and "a.m()" invocation
- computeResult(target, RESOLVED_UNIT8, matcher: isResolveUnitReferencesTask);
- CompilationUnit unit = outputs[RESOLVED_UNIT8];
- // walk the AST
- FunctionDeclaration function = unit.declarations[1];
- BlockFunctionBody body = function.functionExpression.body;
- ExpressionStatement statement = body.block.statements[0];
- MethodInvocation invocation = statement.expression;
- expect(unit, same(outputs[RESOLVED_UNIT8]));
- // a.m() is resolved now
- expect(invocation.methodName.staticElement, isNotNull);
- }
-
- test_perform_errors() {
- Source source = newSource(
- '/test.dart',
- '''
-class A {
-}
-main(A a) {
- a.unknownMethod();
-}
-''');
- LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
- computeResult(target, RESOLVED_UNIT8, matcher: isResolveUnitReferencesTask);
- // validate
- _fillErrorListener(RESOLVE_REFERENCES_ERRORS);
- errorListener.assertErrorsWithCodes(
- <ErrorCode>[StaticTypeWarningCode.UNDEFINED_METHOD]);
- }
-
- test_perform_importExport() {
- newSource(
- '/a.dart',
- '''
-library a;
-class A<T> {
- T m() {}
-}
-''');
- newSource(
- '/b.dart',
- '''
-library b;
-export 'a.dart';
-''');
- Source sourceC = newSource(
- '/c.dart',
- '''
-library c;
-import 'b.dart';
-main() {
- new A<int>().m();
-}
-''');
- computeResult(new LibrarySpecificUnit(sourceC, sourceC), RESOLVED_UNIT8,
- matcher: isResolveUnitReferencesTask);
- // validate
- CompilationUnit unit = outputs[RESOLVED_UNIT8];
- expect(unit, isNotNull);
- FunctionDeclaration functionDeclaration = unit.declarations[0];
- BlockFunctionBody body = functionDeclaration.functionExpression.body;
- List<Statement> statements = body.block.statements;
- ExpressionStatement statement = statements[0];
- MethodInvocation invocation = statement.expression;
- MethodElement methodElement = invocation.methodName.staticElement;
- expect(methodElement, isNotNull);
- expect(methodElement.type, isNotNull);
- expect(methodElement.returnType.toString(), 'int');
- }
-}
-
-@reflectiveTest
class ResolveUnitTypeNamesTaskTest extends _AbstractDartTaskTest {
test_perform() {
Source source = newSource(
« no previous file with comments | « pkg/analyzer/lib/src/task/dart_work_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698