Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit e8eb0db

Browse files
committed
test: fix the progress tests
1 parent 59efb36 commit e8eb0db

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

tests/client.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,13 @@ fn client_test_simple_workspace() {
175175
let count = rls
176176
.messages()
177177
.iter()
178-
.filter(|msg| msg["method"] == "window/progress")
179-
.filter(|msg| msg["params"]["title"] == "Building")
178+
.filter(|msg| msg["method"] == "$/progress")
179+
.filter(|msg| msg["kind"] == "report")
180180
.filter(|msg| {
181-
msg["params"]["message"].as_str().map(|x| x.starts_with("member_")).unwrap_or(false)
181+
msg["params"]["value"]["message"]
182+
.as_str()
183+
.map(|x| x.starts_with("member_"))
184+
.unwrap_or(false)
182185
})
183186
.count();
184187
assert_eq!(count, 4);

tests/support/client/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,7 @@ impl<T: AsyncRead + AsyncWrite> RlsHandle<T> {
265265
/// Blocks until the processing (building + indexing) is done by the RLS.
266266
#[allow(clippy::bool_comparison)]
267267
pub fn wait_for_indexing(&mut self) {
268-
self.wait_for_message(|msg| {
269-
msg["params"]["title"] == "Indexing" && msg["params"]["done"] == true
270-
});
268+
self.wait_for_message(|msg| msg["params"]["value"]["kind"] == "end");
271269
}
272270

273271
/// Blocks until a "textDocument/publishDiagnostics" message is received.

0 commit comments

Comments
 (0)