diff options
Diffstat (limited to 'crates/ra_lsp_server/tests')
-rw-r--r-- | crates/ra_lsp_server/tests/heavy_tests/support.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/support.rs b/crates/ra_lsp_server/tests/heavy_tests/support.rs index c14d287ca..82ba12f87 100644 --- a/crates/ra_lsp_server/tests/heavy_tests/support.rs +++ b/crates/ra_lsp_server/tests/heavy_tests/support.rs | |||
@@ -118,7 +118,11 @@ impl Server { | |||
118 | } | 118 | } |
119 | fn send_request_(&self, r: RawRequest) -> Value { | 119 | fn send_request_(&self, r: RawRequest) -> Value { |
120 | let id = r.id; | 120 | let id = r.id; |
121 | self.worker.as_ref().unwrap().send(RawMessage::Request(r)); | 121 | self.worker |
122 | .as_ref() | ||
123 | .unwrap() | ||
124 | .send(RawMessage::Request(r)) | ||
125 | .unwrap(); | ||
122 | while let Some(msg) = self.recv() { | 126 | while let Some(msg) = self.recv() { |
123 | match msg { | 127 | match msg { |
124 | RawMessage::Request(req) => panic!("unexpected request: {:?}", req), | 128 | RawMessage::Request(req) => panic!("unexpected request: {:?}", req), |
@@ -167,7 +171,8 @@ impl Server { | |||
167 | self.worker | 171 | self.worker |
168 | .as_ref() | 172 | .as_ref() |
169 | .unwrap() | 173 | .unwrap() |
170 | .send(RawMessage::Notification(not)); | 174 | .send(RawMessage::Notification(not)) |
175 | .unwrap(); | ||
171 | } | 176 | } |
172 | } | 177 | } |
173 | 178 | ||
@@ -185,7 +190,7 @@ impl Drop for Server { | |||
185 | fn recv_timeout(receiver: &Receiver<RawMessage>) -> Option<RawMessage> { | 190 | fn recv_timeout(receiver: &Receiver<RawMessage>) -> Option<RawMessage> { |
186 | let timeout = Duration::from_secs(5); | 191 | let timeout = Duration::from_secs(5); |
187 | select! { | 192 | select! { |
188 | recv(receiver, msg) => msg, | 193 | recv(receiver) -> msg => msg.ok(), |
189 | recv(after(timeout)) => panic!("timed out"), | 194 | recv(after(timeout)) -> _ => panic!("timed out"), |
190 | } | 195 | } |
191 | } | 196 | } |