Fix a few Windows tests (#19773)
This commit is contained in:
parent
fc8a72cdd8
commit
d7a277607b
3 changed files with 43 additions and 11 deletions
|
@ -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"))]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue