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

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

Issue 1850673004: Add support for type inference involving generics. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
« no previous file with comments | « pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart ('k') | 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.summary_common; 5 library analyzer.test.src.summary.summary_common;
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/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/src/dart/scanner/reader.dart'; 10 import 'package:analyzer/src/dart/scanner/reader.dart';
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 ? contains(constCycleSlot) 224 ? contains(constCycleSlot)
225 : isNot(contains(constCycleSlot))); 225 : isNot(contains(constCycleSlot)));
226 } 226 }
227 } 227 }
228 228
229 /** 229 /**
230 * Verify that the [dependency]th element of the dependency table represents 230 * Verify that the [dependency]th element of the dependency table represents
231 * a file reachable via the given [absoluteUri] and [relativeUri]. 231 * a file reachable via the given [absoluteUri] and [relativeUri].
232 */ 232 */
233 void checkDependency(int dependency, String absoluteUri, String relativeUri) { 233 void checkDependency(int dependency, String absoluteUri, String relativeUri) {
234 expect(dependency, new isInstanceOf<int>());
234 if (expectAbsoluteUrisInDependencies) { 235 if (expectAbsoluteUrisInDependencies) {
235 // The element model doesn't (yet) store enough information to recover 236 // The element model doesn't (yet) store enough information to recover
236 // relative URIs, so we have to use the absolute URI. 237 // relative URIs, so we have to use the absolute URI.
237 // TODO(paulberry): fix this. 238 // TODO(paulberry): fix this.
238 relativeUri = absoluteUri; 239 expect(linked.dependencies[dependency].uri, absoluteUri);
240 } else if (dependency >= linked.numPrelinkedDependencies) {
241 // Fully-linked dependencies are always absolute URIs.
242 expect(linked.dependencies[dependency].uri, absoluteUri);
243 } else {
244 expect(linked.dependencies[dependency].uri, relativeUri);
239 } 245 }
240 expect(dependency, new isInstanceOf<int>());
241 expect(linked.dependencies[dependency].uri, relativeUri);
242 } 246 }
243 247
244 /** 248 /**
245 * Verify that the given [dependency] lists the given [absoluteUris] or 249 * Verify that the given [dependency] lists the given [absoluteUris] or
246 * [relativeUris] as its parts. 250 * [relativeUris] as its parts.
247 */ 251 */
248 void checkDependencyParts(LinkedDependency dependency, 252 void checkDependencyParts(LinkedDependency dependency,
249 List<String> absoluteUris, List<String> relativeUris) { 253 List<String> absoluteUris, List<String> relativeUris) {
250 if (expectAbsoluteUrisInDependencies) { 254 if (expectAbsoluteUrisInDependencies) {
251 // The element model doesn't (yet) store enough information to recover 255 // The element model doesn't (yet) store enough information to recover
(...skipping 8035 matching lines...) Expand 10 before | Expand all | Expand 10 after
8287 class _PrefixExpectation { 8291 class _PrefixExpectation {
8288 final ReferenceKind kind; 8292 final ReferenceKind kind;
8289 final String name; 8293 final String name;
8290 final String absoluteUri; 8294 final String absoluteUri;
8291 final String relativeUri; 8295 final String relativeUri;
8292 final int numTypeParameters; 8296 final int numTypeParameters;
8293 8297
8294 _PrefixExpectation(this.kind, this.name, 8298 _PrefixExpectation(this.kind, this.name,
8295 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); 8299 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
8296 } 8300 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/summarize_ast_strong_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698