mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
tests/cp: add test to copy from stdin
This commit is contained in:
parent
b75d0f9446
commit
c6d1923701
1 changed files with 16 additions and 0 deletions
|
@ -6031,3 +6031,19 @@ fn test_cp_preserve_xattr_readonly_source() {
|
|||
"Extended attributes were not preserved"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn test_cp_from_stdin() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let target = "target";
|
||||
let test_string = "Hello, World!\n";
|
||||
|
||||
ucmd.arg("/dev/fd/0")
|
||||
.arg(target)
|
||||
.pipe_in(test_string)
|
||||
.succeeds();
|
||||
|
||||
assert!(at.file_exists(target));
|
||||
assert_eq!(at.read(target), test_string);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue