| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |