Fix a few Windows tests (#19773)

This commit is contained in:
Kirill Bulatov 2024-10-26 03:32:22 +03:00 committed by GitHub
parent fc8a72cdd8
commit d7a277607b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 43 additions and 11 deletions

View file

@ -1177,6 +1177,8 @@ impl FakeLanguageServer {
let (stdout_writer, stdout_reader) = async_pipe::pipe();
let (notifications_tx, notifications_rx) = channel::unbounded();
let root = Self::root_path();
let mut server = LanguageServer::new_internal(
server_id,
stdin_writer,
@ -1184,8 +1186,8 @@ impl FakeLanguageServer {
None::<async_pipe::PipeReader>,
Arc::new(Mutex::new(None)),
None,
Path::new("/"),
Path::new("/"),
root,
root,
None,
cx.clone(),
|_| {},
@ -1201,8 +1203,8 @@ impl FakeLanguageServer {
None::<async_pipe::PipeReader>,
Arc::new(Mutex::new(None)),
None,
Path::new("/"),
Path::new("/"),
root,
root,
None,
cx,
move |msg| {
@ -1238,6 +1240,16 @@ impl FakeLanguageServer {
(server, fake)
}
#[cfg(target_os = "windows")]
fn root_path() -> &'static Path {
Path::new("C:\\")
}
#[cfg(not(target_os = "windows"))]
fn root_path() -> &'static Path {
Path::new("/")
}
}
#[cfg(any(test, feature = "test-support"))]