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

Unified Diff: pkg/analyzer/test/src/summary/summary_test.dart

Issue 1468583002: Add a unit index to prelinked type references in summaries. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove an unnecessary TODO. Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | pkg/analyzer/tool/summary/idl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/summary_test.dart
diff --git a/pkg/analyzer/test/src/summary/summary_test.dart b/pkg/analyzer/test/src/summary/summary_test.dart
index 89f58cfb574751c2abc6f1679aed98b737819f39..6b8bfcbd786b6a2c8268b34f4875ba3e59636603 100644
--- a/pkg/analyzer/test/src/summary/summary_test.dart
+++ b/pkg/analyzer/test/src/summary/summary_test.dart
@@ -210,8 +210,8 @@ abstract class SummaryTest {
String relativeUri, String expectedName,
{String expectedPrefix,
bool allowTypeParameters: false,
- PrelinkedReferenceKind expectedKind:
- PrelinkedReferenceKind.classOrEnum}) {
+ PrelinkedReferenceKind expectedKind: PrelinkedReferenceKind.classOrEnum,
+ int expectedUnit: 0}) {
expect(typeRef, new isInstanceOf<UnlinkedTypeRef>());
expect(typeRef.paramReference, 0);
int index = typeRef.reference;
@@ -240,6 +240,7 @@ abstract class SummaryTest {
}
}
expect(referenceResolution.kind, expectedKind);
+ expect(referenceResolution.unit, expectedUnit);
}
/**
@@ -1659,7 +1660,8 @@ class C {
otherDeclarations: 'library my.lib; import "a.dart";'),
absUri('/a.dart'),
'a.dart',
- 'C');
+ 'C',
+ expectedUnit: 1);
}
test_type_reference_to_imported_part_with_prefix() {
@@ -1671,7 +1673,8 @@ class C {
absUri('/a.dart'),
'a.dart',
'C',
- expectedPrefix: 'p');
+ expectedPrefix: 'p',
+ expectedUnit: 1);
}
test_type_reference_to_internal_class() {
@@ -1700,7 +1703,8 @@ class C {
otherDeclarations: 'library my.lib; part "a.dart";'),
null,
null,
- 'C');
+ 'C',
+ expectedUnit: 1);
}
test_type_reference_to_nonexistent_file_via_prefix() {
@@ -1724,7 +1728,7 @@ class C {
// The referenced unit should be 2, since unit 0 is a.dart and unit 1 is
// b.dart. a.dart and b.dart are counted even though nothing is imported
// from them.
- checkTypeRef(typeRef, absUri('/a.dart'), 'a.dart', 'C');
+ checkTypeRef(typeRef, absUri('/a.dart'), 'a.dart', 'C', expectedUnit: 2);
}
test_type_unresolved() {
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_elements.dart ('k') | pkg/analyzer/tool/summary/idl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698