mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
Merge pull request #5016 from cakebaker/cp_fix_unused_var_warning_on_windows
cp: fix "unused variable" warning on Windows
This commit is contained in:
commit
5ce7ae56b6
1 changed files with 24 additions and 12 deletions
|
@ -3127,6 +3127,17 @@ 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");
|
||||||
|
|
||||||
|
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
|
||||||
|
ts.ucmd()
|
||||||
|
.arg("--debug")
|
||||||
|
.arg("--sparse=auto")
|
||||||
|
.arg("a")
|
||||||
|
.arg("b")
|
||||||
|
.succeeds();
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||||
|
{
|
||||||
let result = ts
|
let result = ts
|
||||||
.ucmd()
|
.ucmd()
|
||||||
.arg("--debug")
|
.arg("--debug")
|
||||||
|
@ -3135,7 +3146,6 @@ fn test_cp_debug_sparse_auto() {
|
||||||
.arg("b")
|
.arg("b")
|
||||||
.succeeds();
|
.succeeds();
|
||||||
|
|
||||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
|
||||||
let stdout_str = result.stdout_str();
|
let stdout_str = result.stdout_str();
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
|
@ -3146,9 +3156,11 @@ fn test_cp_debug_sparse_auto() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
if !stdout_str.contains("copy offload: unknown, reflink: unsupported, sparse detection: no") {
|
if !stdout_str.contains("copy offload: unknown, reflink: unsupported, sparse detection: no")
|
||||||
|
{
|
||||||
panic!("Failure: stdout was \n{stdout_str}");
|
panic!("Failure: stdout was \n{stdout_str}");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue