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

Side by Side Diff: pkg/analyzer/test/src/summary/summarize_ast_test.dart

Issue 1845403003: Begin implementing type inference for AST summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Break a long line. Created 4 years, 8 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
OLDNEW
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.src.summary.summarize_ast_test; 5 library analyzer.test.src.summary.summarize_ast_test;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast.dart'; 8 import 'package:analyzer/dart/ast/ast.dart';
9 import 'package:analyzer/dart/ast/token.dart'; 9 import 'package:analyzer/dart/ast/token.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 return linkedLibrary; 198 return linkedLibrary;
199 } 199 }
200 UnlinkedUnit getUnit(String absoluteUri) { 200 UnlinkedUnit getUnit(String absoluteUri) {
201 UnlinkedUnit unit = uriToUnit[absoluteUri] ?? 201 UnlinkedUnit unit = uriToUnit[absoluteUri] ??
202 SerializedMockSdk.instance.uriToUnlinkedUnit[absoluteUri]; 202 SerializedMockSdk.instance.uriToUnlinkedUnit[absoluteUri];
203 if (unit == null && !allowMissingFiles) { 203 if (unit == null && !allowMissingFiles) {
204 fail('Linker unexpectedly requested unit for "$absoluteUri".'); 204 fail('Linker unexpectedly requested unit for "$absoluteUri".');
205 } 205 }
206 return unit; 206 return unit;
207 } 207 }
208 linked = link(uriToUnit.keys.toSet(), getDependency, getUnit)[ 208 linked = link(uriToUnit.keys.toSet(), getDependency, getUnit, strongMode)[
209 testDartUri.toString()]; 209 testDartUri.toString()];
210 expect(linked, isNotNull); 210 expect(linked, isNotNull);
211 validateLinkedLibrary(linked); 211 validateLinkedLibrary(linked);
212 unlinkedUnits = <UnlinkedUnit>[definingUnit]; 212 unlinkedUnits = <UnlinkedUnit>[definingUnit];
213 for (String relativeUri in definingUnit.publicNamespace.parts) { 213 for (String relativeUri in definingUnit.publicNamespace.parts) {
214 UnlinkedUnit unit = uriToUnit[ 214 UnlinkedUnit unit = uriToUnit[
215 resolveRelativeUri(testDartUri, Uri.parse(relativeUri)).toString()]; 215 resolveRelativeUri(testDartUri, Uri.parse(relativeUri)).toString()];
216 if (unit == null) { 216 if (unit == null) {
217 if (!allowMissingFiles) { 217 if (!allowMissingFiles) {
218 fail('Test referred to unknown unit $relativeUri'); 218 fail('Test referred to unknown unit $relativeUri');
(...skipping 14 matching lines...) Expand all
233 CompilationUnit _parseText(String text) { 233 CompilationUnit _parseText(String text) {
234 CharSequenceReader reader = new CharSequenceReader(text); 234 CharSequenceReader reader = new CharSequenceReader(text);
235 Scanner scanner = 235 Scanner scanner =
236 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER); 236 new Scanner(null, reader, AnalysisErrorListener.NULL_LISTENER);
237 Token token = scanner.tokenize(); 237 Token token = scanner.tokenize();
238 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER); 238 Parser parser = new Parser(null, AnalysisErrorListener.NULL_LISTENER);
239 parser.parseGenericMethods = true; 239 parser.parseGenericMethods = true;
240 return parser.parseCompilationUnit(token); 240 return parser.parseCompilationUnit(token);
241 } 241 }
242 } 242 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart ('k') | pkg/analyzer/test/src/task/strong_mode_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698