mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
tests/head: add test to write to /dev/full
This commit is contained in:
parent
5fe6706c51
commit
9202f23787
1 changed files with 22 additions and 0 deletions
|
@ -475,3 +475,25 @@ fn test_all_but_last_lines() {
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_is_fixture("lorem_ipsum_backwards_15_lines.expected");
|
.stdout_is_fixture("lorem_ipsum_backwards_15_lines.expected");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "netbsd"))]
|
||||||
|
#[test]
|
||||||
|
fn test_write_to_dev_full() {
|
||||||
|
use std::fs::OpenOptions;
|
||||||
|
|
||||||
|
for append in [true, false] {
|
||||||
|
{
|
||||||
|
let dev_full = OpenOptions::new()
|
||||||
|
.write(true)
|
||||||
|
.append(append)
|
||||||
|
.open("/dev/full")
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
new_ucmd!()
|
||||||
|
.pipe_in_fixture(INPUT)
|
||||||
|
.set_stdout(dev_full)
|
||||||
|
.run()
|
||||||
|
.stderr_contains("No space left on device");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue