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

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

Issue 1175843003: Fix a test to work with the new task model (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library engine.resolver_test; 5 library engine.resolver_test;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/src/context/context.dart' as newContext; 9 import 'package:analyzer/src/context/context.dart' as newContext;
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 9149 matching lines...) Expand 10 before | Expand all | Expand 10 after
9160 void test_localVariable_types_invoked() { 9160 void test_localVariable_types_invoked() {
9161 Source source = addSource(r''' 9161 Source source = addSource(r'''
9162 const A = null; 9162 const A = null;
9163 main() { 9163 main() {
9164 var myVar = (int p) => 'foo'; 9164 var myVar = (int p) => 'foo';
9165 myVar(42); 9165 myVar(42);
9166 }'''); 9166 }''');
9167 LibraryElement library = resolve(source); 9167 LibraryElement library = resolve(source);
9168 expect(library, isNotNull); 9168 expect(library, isNotNull);
9169 CompilationUnit unit = 9169 CompilationUnit unit =
9170 analysisContext.getResolvedCompilationUnit(source, library); 9170 analysisContext.resolveCompilationUnit(source, library);
9171 expect(unit, isNotNull); 9171 expect(unit, isNotNull);
9172 List<bool> found = [false]; 9172 List<bool> found = [false];
9173 List<CaughtException> thrownException = new List<CaughtException>(1); 9173 List<CaughtException> thrownException = new List<CaughtException>(1);
9174 unit.accept(new _SimpleResolverTest_localVariable_types_invoked( 9174 unit.accept(new _SimpleResolverTest_localVariable_types_invoked(
9175 this, found, thrownException)); 9175 this, found, thrownException));
9176 if (thrownException[0] != null) { 9176 if (thrownException[0] != null) {
9177 throw new AnalysisException( 9177 throw new AnalysisException(
9178 "Exception", new CaughtException(thrownException[0], null)); 9178 "Exception", new CaughtException(thrownException[0], null));
9179 } 9179 }
9180 expect(found[0], isTrue); 9180 expect(found[0], isTrue);
(...skipping 4694 matching lines...) Expand 10 before | Expand all | Expand 10 after
13875 // check propagated type 13875 // check propagated type
13876 FunctionType propagatedType = node.propagatedType as FunctionType; 13876 FunctionType propagatedType = node.propagatedType as FunctionType;
13877 expect(propagatedType.returnType, test.typeProvider.stringType); 13877 expect(propagatedType.returnType, test.typeProvider.stringType);
13878 } on AnalysisException catch (e, stackTrace) { 13878 } on AnalysisException catch (e, stackTrace) {
13879 thrownException[0] = new CaughtException(e, stackTrace); 13879 thrownException[0] = new CaughtException(e, stackTrace);
13880 } 13880 }
13881 } 13881 }
13882 return null; 13882 return null;
13883 } 13883 }
13884 } 13884 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698