Merge pull request #3109 from gitbutlerapp/fix-alternates-test-path-handling

fix test alternates test to be more robust
This commit is contained in:
Josh Junon 2024-03-11 17:03:25 +01:00 committed by GitHub
commit f2413bbfbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -965,6 +965,8 @@ pub enum RemoteError {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use std::path::PathBuf;
use anyhow::Result; use anyhow::Result;
use pretty_assertions::assert_eq; use pretty_assertions::assert_eq;
@ -985,13 +987,10 @@ mod test {
.join("objects/info/alternates"), .join("objects/info/alternates"),
)?; )?;
assert_eq!( let file_content = PathBuf::from(file_content.trim());
file_content.as_str(), let project_path = project_repository.path().to_path_buf().join(".git/objects");
format!(
"{}/.git/objects\n", assert_eq!(file_content, project_path);
project_repository.path().to_str().unwrap()
)
);
Ok(()) Ok(())
} }