1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

cp: fix "unused variable" warning on Windows

This commit is contained in:
Daniel Hofstetter 2023-06-27 16:46:50 +02:00
parent 461047c6a6
commit 732dbb3f12

View file

@ -3127,8 +3127,9 @@ fn test_cp_debug_sparse_auto() {
let ts = TestScenario::new(util_name!()); let ts = TestScenario::new(util_name!());
let at = &ts.fixtures; let at = &ts.fixtures;
at.touch("a"); at.touch("a");
let result = ts
.ucmd() #[cfg(not(any(target_os = "linux", target_os = "macos")))]
ts.ucmd()
.arg("--debug") .arg("--debug")
.arg("--sparse=auto") .arg("--sparse=auto")
.arg("a") .arg("a")
@ -3136,18 +3137,29 @@ fn test_cp_debug_sparse_auto() {
.succeeds(); .succeeds();
#[cfg(any(target_os = "linux", target_os = "macos"))] #[cfg(any(target_os = "linux", target_os = "macos"))]
let stdout_str = result.stdout_str();
#[cfg(target_os = "macos")]
if !stdout_str
.contains("copy offload: unknown, reflink: unsupported, sparse detection: unsupported")
{ {
panic!("Failure: stdout was \n{stdout_str}"); let result = ts
} .ucmd()
.arg("--debug")
.arg("--sparse=auto")
.arg("a")
.arg("b")
.succeeds();
#[cfg(target_os = "linux")] let stdout_str = result.stdout_str();
if !stdout_str.contains("copy offload: unknown, reflink: unsupported, sparse detection: no") {
panic!("Failure: stdout was \n{stdout_str}"); #[cfg(target_os = "macos")]
if !stdout_str
.contains("copy offload: unknown, reflink: unsupported, sparse detection: unsupported")
{
panic!("Failure: stdout was \n{stdout_str}");
}
#[cfg(target_os = "linux")]
if !stdout_str.contains("copy offload: unknown, reflink: unsupported, sparse detection: no")
{
panic!("Failure: stdout was \n{stdout_str}");
}
} }
} }