Skip to content

Commit ca83797

Browse files
tests/install: add stdin test using fd from /proc directly
1 parent 370a0b4 commit ca83797

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/by-util/test_install.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,3 +1751,19 @@ fn test_install_from_fifo() {
17511751
assert!(s.fixtures.file_exists(target_name));
17521752
assert_eq!(s.fixtures.read(target_name), test_string);
17531753
}
1754+
1755+
#[test]
1756+
#[cfg(unix)]
1757+
fn test_install_from_stdin() {
1758+
let (at, mut ucmd) = at_and_ucmd!();
1759+
let target = "target";
1760+
let test_string = "Hello, World!\n";
1761+
1762+
ucmd.arg("/proc/self/fd/0")
1763+
.arg(target)
1764+
.pipe_in(test_string)
1765+
.succeeds();
1766+
1767+
assert!(at.file_exists(target));
1768+
assert_eq!(at.read(target), test_string);
1769+
}

0 commit comments

Comments
 (0)