Skip to content

Commit 7b13bf7

Browse files
devoncarewCommit Queue
authored andcommitted
[analysis_server] move package:matcher to a dev_dependency
Change-Id: Id4ed2ea8c960ca35bb1abbe74fdf2a711baf3c1d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/402586 Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Devon Carew <[email protected]>
1 parent 242a20e commit 7b13bf7

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

pkg/analysis_server/lib/src/utilities/mocks.dart

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import 'package:analyzer/dart/analysis/context_root.dart' as analyzer;
1111
import 'package:analyzer_plugin/protocol/protocol.dart' as plugin;
1212
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
1313
import 'package:analyzer_plugin/src/protocol/protocol_internal.dart' as plugin;
14-
import 'package:matcher/expect.dart';
1514
import '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) {

pkg/analysis_server/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

pkg/analysis_server/test/socket_server_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
}

0 commit comments

Comments
 (0)