File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import 'package:analyzer/dart/analysis/context_root.dart' as analyzer;
1111import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
1212import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
1313import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
14- import 'package:matcher/expect.dart' ;
1514import 'package:watcher/watcher.dart' ;
1615
1716/// A mock [ServerCommunicationChannel] for testing [AnalysisServer] .
@@ -47,11 +46,6 @@ class MockServerChannel implements ServerCommunicationChannel {
4746 _closed = true ;
4847 }
4948
50- void expectMsgCount ({int responseCount = 0 , int notificationCount = 0 }) {
51- expect (responsesReceived, hasLength (responseCount));
52- expect (notificationsReceived, hasLength (notificationCount));
53- }
54-
5549 @override
5650 void sendNotification (Notification notification) {
5751 // Don't deliver notifications after the connection is closed.
@@ -188,7 +182,7 @@ class TestPluginManager implements PluginManager {
188182
189183 @override
190184 dynamic noSuchMethod (Invocation invocation) =>
191- fail ('Unexpected invocation of ${invocation .memberName }' );
185+ throw Exception ('Unexpected invocation of ${invocation .memberName }' );
192186
193187 @override
194188 void removedContextRoot (analyzer.ContextRoot contextRoot) {
Original file line number Diff line number Diff line change @@ -21,7 +21,6 @@ dependencies:
2121 json_rpc_2 : any
2222 language_server_protocol : any
2323 linter : any
24- matcher : any
2524 memory_usage : any
2625 meta : any
2726 path : any
@@ -40,6 +39,7 @@ dev_dependencies:
4039 cli_util : any
4140 lints : any
4241 logging : any
42+ matcher : any
4343 test : any
4444 test_descriptor : any
4545 test_reflective_loader : any
Original file line number Diff line number Diff line change @@ -98,3 +98,10 @@ class SocketServerTest {
9898 return server;
9999 }
100100}
101+
102+ extension on MockServerChannel {
103+ void expectMsgCount ({int responseCount = 0 , int notificationCount = 0 }) {
104+ expect (responsesReceived, hasLength (responseCount));
105+ expect (notificationsReceived, hasLength (notificationCount));
106+ }
107+ }
You can’t perform that action at this time.
0 commit comments