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

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

Issue 2825503002: Revert "Revert "Report error if the same uri appears in multiple summaries."" (Closed)
Patch Set: Fix broken test Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/package_bundle_reader.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
diff --git a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
index 0eb1ed1d53e913fe3f4a2a4dfbd8efc3eb359e62..a1caba3d0bbe41d31617998c092eb81c8708e8b1 100644
--- a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
+++ b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
@@ -249,7 +249,9 @@ class SummaryDataStoreTest {
when(bundle.linkedLibraries)
.thenReturn(<LinkedLibrary>[linkedLibrary2, linkedLibrary1]);
when(bundle.apiSignature).thenReturn('signature');
- dataStore.addBundle('/p3.ds', bundle);
+ // p3 conflicts (overlaps) with existing summaries.
+ expect(() => dataStore.addBundle('/p3.ds', bundle),
+ throwsA(isConflictingSummaryException));
expect(dataStore.dependencies.last.includedPackageNames, ['p1', 'p2']);
}
@@ -316,3 +318,12 @@ class _UnlinkedPublicNamespaceMock extends TypedMock
implements UnlinkedPublicNamespace {}
class _UnlinkedUnitMock extends TypedMock implements UnlinkedUnit {}
+
+/// A matcher for ConflictingSummaryException.
+const Matcher isConflictingSummaryException =
+ const _ConflictingSummaryException();
+
+class _ConflictingSummaryException extends TypeMatcher {
+ const _ConflictingSummaryException() : super("ConflictingSummaryException");
+ bool matches(item, Map matchState) => item is ConflictingSummaryException;
+}
« no previous file with comments | « pkg/analyzer/lib/src/summary/package_bundle_reader.dart ('k') | pkg/analyzer_cli/lib/src/build_mode.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698