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 8641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8652 // References to other parts should still be resolved. | 8652 // References to other parts should still be resolved. |
8653 allowMissingFiles = true; | 8653 allowMissingFiles = true; |
8654 addNamedSource('/bar.dart', 'part of my.lib; class C {}'); | 8654 addNamedSource('/bar.dart', 'part of my.lib; class C {}'); |
8655 serializeLibraryText( | 8655 serializeLibraryText( |
8656 'library my.lib; part "foo.dart"; part "bar.dart"; C c;', | 8656 'library my.lib; part "foo.dart"; part "bar.dart"; C c;', |
8657 allowErrors: true); | 8657 allowErrors: true); |
8658 checkTypeRef(findVariable('c').type, null, null, 'C', | 8658 checkTypeRef(findVariable('c').type, null, null, 'C', |
8659 expectedTargetUnit: 2); | 8659 expectedTargetUnit: 2); |
8660 } | 8660 } |
8661 | 8661 |
| 8662 test_lineStarts() { |
| 8663 String text = ''' |
| 8664 int foo; |
| 8665 class Test {} |
| 8666 |
| 8667 int bar;''' |
| 8668 .replaceAll('\r\n', '\n'); |
| 8669 serializeLibraryText(text); |
| 8670 expect(unlinkedUnits[0].lineStarts, [0, 9, 23, 24]); |
| 8671 } |
| 8672 |
8662 test_linked_reference_reuse() { | 8673 test_linked_reference_reuse() { |
8663 if (skipFullyLinkedData) { | 8674 if (skipFullyLinkedData) { |
8664 return; | 8675 return; |
8665 } | 8676 } |
8666 // When the reference for a linked type is the same as an explicitly | 8677 // When the reference for a linked type is the same as an explicitly |
8667 // referenced type, the explicit reference should be re-used. | 8678 // referenced type, the explicit reference should be re-used. |
8668 addNamedSource('/a.dart', 'class C {}'); | 8679 addNamedSource('/a.dart', 'class C {}'); |
8669 addNamedSource('/b.dart', 'import "a.dart"; C f() => null;'); | 8680 addNamedSource('/b.dart', 'import "a.dart"; C f() => null;'); |
8670 serializeLibraryText( | 8681 serializeLibraryText( |
8671 'import "a.dart"; import "b.dart"; C c1; final c2 = f();'); | 8682 'import "a.dart"; import "b.dart"; C c1; final c2 = f();'); |
(...skipping 1854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10526 class _PrefixExpectation { | 10537 class _PrefixExpectation { |
10527 final ReferenceKind kind; | 10538 final ReferenceKind kind; |
10528 final String name; | 10539 final String name; |
10529 final String absoluteUri; | 10540 final String absoluteUri; |
10530 final String relativeUri; | 10541 final String relativeUri; |
10531 final int numTypeParameters; | 10542 final int numTypeParameters; |
10532 | 10543 |
10533 _PrefixExpectation(this.kind, this.name, | 10544 _PrefixExpectation(this.kind, this.name, |
10534 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); | 10545 {this.absoluteUri, this.relativeUri, this.numTypeParameters: 0}); |
10535 } | 10546 } |
OLD | NEW |