We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b75d0f9 commit c6d1923Copy full SHA for c6d1923
tests/by-util/test_cp.rs
@@ -6031,3 +6031,19 @@ fn test_cp_preserve_xattr_readonly_source() {
6031
"Extended attributes were not preserved"
6032
);
6033
}
6034
+
6035
+#[test]
6036
+#[cfg(unix)]
6037
+fn test_cp_from_stdin() {
6038
+ let (at, mut ucmd) = at_and_ucmd!();
6039
+ let target = "target";
6040
+ let test_string = "Hello, World!\n";
6041
6042
+ ucmd.arg("/dev/fd/0")
6043
+ .arg(target)
6044
+ .pipe_in(test_string)
6045
+ .succeeds();
6046
6047
+ assert!(at.file_exists(target));
6048
+ assert_eq!(at.read(target), test_string);
6049
+}
0 commit comments