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

Commit c1f3c17

Browse files
committed
Fix test learn_client_use_change_watched on Windows
1 parent 9bbf3b9 commit c1f3c17

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/actions/notifications.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,20 +299,25 @@ mod test {
299299

300300
#[test]
301301
fn learn_client_use_change_watched() {
302+
let (project_root, lsp_project_manifest) = if cfg!(windows) {
303+
("C:/some/dir", "file:c:/some/dir/Cargo.toml")
304+
} else {
305+
("/some/dir", "file:///some/dir/Cargo.toml")
306+
};
307+
302308
let mut ctx = InitActionContext::new(
303309
Arc::new(AnalysisHost::new(Target::Debug)),
304310
Arc::new(Vfs::new()),
305311
<_>::default(),
306312
<_>::default(),
307-
"/some/dir".into(),
313+
project_root.into(),
308314
123,
309315
false,
310316
);
311317

312318
assert!(!ctx.client_use_change_watched);
313319

314-
let manifest_change = Url::parse("file:///some/dir/Cargo.toml").unwrap();
315-
320+
let manifest_change = Url::parse(lsp_project_manifest).unwrap();
316321
DidChangeWatchedFiles::handle(
317322
DidChangeWatchedFilesParams {
318323
changes: vec![FileEvent::new(manifest_change, FileChangeType::Changed)],

0 commit comments

Comments
 (0)