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

Unified Diff: pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart

Issue 2983913002: Add utility method to SubscriptionManager (Closed)
Patch Set: Created 3 years, 5 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_plugin/lib/utilities/subscriptions/subscription_manager.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart
diff --git a/pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart b/pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart
index 4bf79ff8283d036a1fee04db8cde11fd4dc4dfd3..49cdae338d9b63c6210439c648a66322ccc3aec0 100644
--- a/pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart
+++ b/pkg/analyzer_plugin/test/utilities/subscriptions/subscription_manager_test.dart
@@ -15,14 +15,36 @@ void main() {
class SubscriptionManagerTest {
SubscriptionManager manager = new SubscriptionManager();
+ String fooPath = '/project/lib/foo.dart';
+ String barPath = '/project/lib/bar.dart';
+ String bazPath = '/project/lib/baz.dart';
+
+ test_hasSubscriptionForFile_differentSubscription() {
+ manager.setSubscriptions({
+ AnalysisService.NAVIGATION: [barPath]
+ });
+ expect(manager.hasSubscriptionForFile(fooPath, AnalysisService.HIGHLIGHTS),
+ isFalse);
+ }
+
+ test_hasSubscriptionForFile_hasSubscription() {
+ manager.setSubscriptions({
+ AnalysisService.HIGHLIGHTS: [fooPath]
+ });
+ expect(manager.hasSubscriptionForFile(fooPath, AnalysisService.HIGHLIGHTS),
+ isTrue);
+ }
+
+ test_hasSubscriptionForFile_noSubscription() {
+ expect(manager.hasSubscriptionForFile(fooPath, AnalysisService.HIGHLIGHTS),
+ isFalse);
+ }
+
test_servicesForFile() {
expect(manager.servicesForFile('/project/lib/test.dart'), hasLength(0));
}
test_setSubscriptions() {
- String fooPath = '/project/lib/foo.dart';
- String barPath = '/project/lib/bar.dart';
- String bazPath = '/project/lib/baz.dart';
//
// Set the initial set of subscriptions.
//
« no previous file with comments | « pkg/analyzer_plugin/lib/utilities/subscriptions/subscription_manager.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698