aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-30 20:23:31 +0000
committerAleksey Kladov <[email protected]>2018-12-30 20:23:31 +0000
commitc2c10b9014549e9c0783fb13dc202dfab6e6fd0a (patch)
treed4b2a47910df5effb14271ab72a1602b5f77ee81 /crates/ra_lsp_server/tests
parenteffc1eae8be338ea949058cc89c39950c25858c5 (diff)
:arrow_up: crossbeam
closes #189
Diffstat (limited to 'crates/ra_lsp_server/tests')
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/support.rs13
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 {
185fn recv_timeout(receiver: &Receiver<RawMessage>) -> Option<RawMessage> { 190fn 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}