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

Side by Side Diff: pkg/analyzer_plugin/test/utilities/subscription_manager_test.dart

Issue 2667823003: Add top-level driver and abstract plugin superclass (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'package:analyzer_plugin/protocol/generated_protocol.dart';
6 import 'package:analyzer_plugin/utilities/subscription_manager.dart';
7 import 'package:test/test.dart';
8 import 'package:test_reflective_loader/test_reflective_loader.dart';
9
10 void main() {
11 defineReflectiveTests(SubscriptionManagerTest);
12 }
13
14 @reflectiveTest
15 class SubscriptionManagerTest {
16 SubscriptionManager manager = new SubscriptionManager();
17
18 test_servicesForFile() {
19 expect(manager.servicesForFile('/project/lib/test.dart'), hasLength(0));
20 }
21
22 test_setSubscriptions() {
23 manager.setSubscriptions({
24 AnalysisService.HIGHLIGHTS: [
25 '/project/lib/foo.dart',
26 '/project/lib/bar.dart'
27 ],
28 AnalysisService.NAVIGATION: ['/project/lib/foo.dart']
29 });
30 expect(manager.servicesForFile('/project/lib/test.dart'), hasLength(0));
31 expect(manager.servicesForFile('/project/lib/bar.dart'),
32 unorderedEquals([AnalysisService.HIGHLIGHTS]));
33 expect(
34 manager.servicesForFile('/project/lib/foo.dart'),
35 unorderedEquals(
36 [AnalysisService.HIGHLIGHTS, AnalysisService.NAVIGATION]));
37 }
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698