Merge pull request #2782 from sylvestre/test_1665

cp: add a unit test for issue 1665
This commit is contained in:
Sylvestre Ledru 2021-12-19 22:49:42 +01:00 committed by GitHub
commit f2f582aa14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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!()