From fd353a9e84299b3dc71cb1efe8c8064cc73e766d Mon Sep 17 00:00:00 2001 From: xtqqczze <45661989+xtqqczze@users.noreply.github.com> Date: Sun, 30 Aug 2026 18:13:07 +0100 Subject: [PATCH] cp: split a test --- tests/by-util/test_cp.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/by-util/test_cp.rs b/tests/by-util/test_cp.rs index bd81c5f76f2..bafe3e266ab 100644 --- a/tests/by-util/test_cp.rs +++ b/tests/by-util/test_cp.rs @@ -1057,7 +1057,7 @@ fn test_cp_reflink_always_failure_dest_cleanup() { #[test] #[cfg(target_os = "linux")] -fn test_cp_reflink_always_failure() { +fn test_cp_reflink_always_invalid_argument() { let scene = TestScenario::new(util_name!()); scene .ucmd() @@ -1065,12 +1065,22 @@ fn test_cp_reflink_always_failure() { .fails() .no_stdout() .stderr_contains("Invalid argument"); +} + +#[test] +#[cfg(target_os = "linux")] +fn test_cp_reflink_always_cross_device() { + let scene = TestScenario::new(util_name!()); scene .ucmd() .args(&["--reflink=always", "/dev/null", "target"]) .fails() .no_stdout() - .stderr_contains("ross-device link"); // cover both of glibc and musl + .stderr_contains(if cfg!(target_env = "musl") { + "'target': Cross-device link" + } else { + "Invalid cross-device link" + }); } #[test]