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

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

Issue 1915033005: Make reference 0 consistent between AST-based and element-based summaries. (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/lib/src/summary/summarize_elements.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 8241 matching lines...) Expand 10 before | Expand all | Expand 10 after
8252 } 8252 }
8253 8253
8254 test_public_namespace_of_part() { 8254 test_public_namespace_of_part() {
8255 addNamedSource('/a.dart', 'part of foo; class C {}'); 8255 addNamedSource('/a.dart', 'part of foo; class C {}');
8256 serializeLibraryText('library foo; part "a.dart";'); 8256 serializeLibraryText('library foo; part "a.dart";');
8257 expect(unlinkedUnits[0].publicNamespace.names, isEmpty); 8257 expect(unlinkedUnits[0].publicNamespace.names, isEmpty);
8258 expect(unlinkedUnits[1].publicNamespace.names, hasLength(1)); 8258 expect(unlinkedUnits[1].publicNamespace.names, hasLength(1));
8259 expect(unlinkedUnits[1].publicNamespace.names[0].name, 'C'); 8259 expect(unlinkedUnits[1].publicNamespace.names[0].name, 'C');
8260 } 8260 }
8261 8261
8262 test_reference_zero() {
8263 // Element zero of the references table should be populated in a standard
8264 // way.
8265 serializeLibraryText('');
8266 UnlinkedReference unlinkedReference0 = unlinkedUnits[0].references[0];
8267 expect(unlinkedReference0.name, '');
8268 expect(unlinkedReference0.prefixReference, 0);
8269 LinkedReference linkedReference0 = linked.units[0].references[0];
8270 expect(linkedReference0.containingReference, 0);
8271 expect(linkedReference0.dependency, 0);
8272 expect(linkedReference0.kind, ReferenceKind.unresolved);
8273 expect(linkedReference0.localIndex, 0);
8274 expect(linkedReference0.name, '');
8275 expect(linkedReference0.numTypeParameters, 0);
8276 expect(linkedReference0.unit, 0);
8277 }
8278
8262 test_setter_documented() { 8279 test_setter_documented() {
8263 String text = ''' 8280 String text = '''
8264 // Extra comment so doc comment offset != 0 8281 // Extra comment so doc comment offset != 0
8265 /** 8282 /**
8266 * Docs 8283 * Docs
8267 */ 8284 */
8268 void set f(value) {}'''; 8285 void set f(value) {}''';
8269 UnlinkedExecutable executable = 8286 UnlinkedExecutable executable =
8270 serializeExecutableText(text, executableName: 'f='); 8287 serializeExecutableText(text, executableName: 'f=');
8271 expect(executable.documentationComment, isNotNull); 8288 expect(executable.documentationComment, isNotNull);
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after
9378 class _PrefixExpectation { 9395 class _PrefixExpectation {
9379 final ReferenceKind kind; 9396 final ReferenceKind kind;
9380 final String name; 9397 final String name;
9381 final String absoluteUri; 9398 final String absoluteUri;
9382 final String relativeUri; 9399 final String relativeUri;
9383 final int numTypeParameters; 9400 final int numTypeParameters;
9384 9401
9385 _PrefixExpectation(this.kind, this.name, 9402 _PrefixExpectation(this.kind, this.name,
9386 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); 9403 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0});
9387 } 9404 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698