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 0d2ded8 commit ac614daCopy full SHA for ac614da
tests/by-util/test_cp.rs
@@ -5914,3 +5914,19 @@ fn test_cp_no_file() {
5914
.code_is(1)
5915
.stderr_contains("error: the following required arguments were not provided:");
5916
}
5917
+
5918
+#[test]
5919
+#[cfg(unix)]
5920
+fn test_cp_from_stdin() {
5921
+ let (at, mut ucmd) = at_and_ucmd!();
5922
+ let target = "target";
5923
+ let test_string = "Hello, World!\n";
5924
5925
+ ucmd.arg("/dev/fd/0")
5926
+ .arg(target)
5927
+ .pipe_in(test_string)
5928
+ .succeeds();
5929
5930
+ assert!(at.file_exists(target));
5931
+ assert_eq!(at.read(target), test_string);
5932
+}
0 commit comments