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

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

Issue 2933753002: Run the sorter to reduce code churn (Closed)
Patch Set: Created 3 years, 6 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
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 13472f3842b7aa1193d3f1ea89db6fca5cc4a313..6dd27edd635951b6a88455b6a9f55d06088308a8 100644
--- a/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
+++ b/pkg/analyzer/test/src/summary/package_bundle_reader_test.dart
@@ -21,6 +21,10 @@ main() {
});
}
+/// A matcher for ConflictingSummaryException.
+const Matcher isConflictingSummaryException =
+ const _ConflictingSummaryException();
+
UnlinkedPublicNamespace _namespaceWithParts(List<String> parts) {
UnlinkedPublicNamespace namespace = new _UnlinkedPublicNamespaceMock();
when(namespace.parts).thenReturn(parts);
@@ -159,29 +163,6 @@ class SummaryDataStoreTest {
LinkedLibrary linkedLibrary1 = new _LinkedLibraryMock();
LinkedLibrary linkedLibrary2 = new _LinkedLibraryMock();
- void _setupDataStore(SummaryDataStore store) {
- // bundle1
- when(unlinkedUnit11.publicNamespace)
- .thenReturn(_namespaceWithParts(['package:p1/u2.dart']));
- when(unlinkedUnit12.publicNamespace).thenReturn(_namespaceWithParts([]));
- when(bundle1.unlinkedUnitUris)
- .thenReturn(<String>['package:p1/u1.dart', 'package:p1/u2.dart']);
- when(bundle1.unlinkedUnits)
- .thenReturn(<UnlinkedUnit>[unlinkedUnit11, unlinkedUnit12]);
- when(bundle1.linkedLibraryUris).thenReturn(<String>['package:p1/u1.dart']);
- when(bundle1.linkedLibraries).thenReturn(<LinkedLibrary>[linkedLibrary1]);
- when(bundle1.apiSignature).thenReturn('signature1');
- store.addBundle('/p1.ds', bundle1);
- // bundle2
- when(unlinkedUnit21.publicNamespace).thenReturn(_namespaceWithParts([]));
- when(bundle2.unlinkedUnitUris).thenReturn(<String>['package:p2/u1.dart']);
- when(bundle2.unlinkedUnits).thenReturn(<UnlinkedUnit>[unlinkedUnit21]);
- when(bundle2.linkedLibraryUris).thenReturn(<String>['package:p2/u1.dart']);
- when(bundle2.linkedLibraries).thenReturn(<LinkedLibrary>[linkedLibrary2]);
- when(bundle2.apiSignature).thenReturn('signature2');
- store.addBundle('/p2.ds', bundle2);
- }
-
void setUp() {
_setupDataStore(dataStore);
}
@@ -296,6 +277,34 @@ class SummaryDataStoreTest {
List<String> uris = dataStore.getContainingLibraryUris(partUri);
expect(uris, isNull);
}
+
+ void _setupDataStore(SummaryDataStore store) {
+ // bundle1
+ when(unlinkedUnit11.publicNamespace)
+ .thenReturn(_namespaceWithParts(['package:p1/u2.dart']));
+ when(unlinkedUnit12.publicNamespace).thenReturn(_namespaceWithParts([]));
+ when(bundle1.unlinkedUnitUris)
+ .thenReturn(<String>['package:p1/u1.dart', 'package:p1/u2.dart']);
+ when(bundle1.unlinkedUnits)
+ .thenReturn(<UnlinkedUnit>[unlinkedUnit11, unlinkedUnit12]);
+ when(bundle1.linkedLibraryUris).thenReturn(<String>['package:p1/u1.dart']);
+ when(bundle1.linkedLibraries).thenReturn(<LinkedLibrary>[linkedLibrary1]);
+ when(bundle1.apiSignature).thenReturn('signature1');
+ store.addBundle('/p1.ds', bundle1);
+ // bundle2
+ when(unlinkedUnit21.publicNamespace).thenReturn(_namespaceWithParts([]));
+ when(bundle2.unlinkedUnitUris).thenReturn(<String>['package:p2/u1.dart']);
+ when(bundle2.unlinkedUnits).thenReturn(<UnlinkedUnit>[unlinkedUnit21]);
+ when(bundle2.linkedLibraryUris).thenReturn(<String>['package:p2/u1.dart']);
+ when(bundle2.linkedLibraries).thenReturn(<LinkedLibrary>[linkedLibrary2]);
+ when(bundle2.apiSignature).thenReturn('signature2');
+ store.addBundle('/p2.ds', bundle2);
+ }
+}
+
+class _ConflictingSummaryException extends TypeMatcher {
+ const _ConflictingSummaryException() : super("ConflictingSummaryException");
+ bool matches(item, Map matchState) => item is ConflictingSummaryException;
}
class _InternalAnalysisContextMock extends TypedMock
@@ -342,12 +351,3 @@ 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/test/src/context/builder_test.dart ('k') | pkg/analyzer/test/src/task/html_work_manager_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698