1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

cp: add a unit test for issue 1665

This commit is contained in:
Sylvestre Ledru 2021-12-19 18:19:48 +01:00
parent cf8ace8f09
commit 59da0d8cd6

View file

@ -731,6 +731,15 @@ fn test_cp_writable_special_file_permissions() {
new_ucmd!().arg("/dev/null").arg("/dev/zero").succeeds();
}
#[test]
#[cfg(unix)]
fn test_cp_issue_1665() {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.arg("/dev/null").arg("foo").succeeds();
assert!(at.file_exists("foo"));
assert_eq!(at.read("foo"), "");
}
#[test]
fn test_cp_preserve_no_args() {
new_ucmd!()