1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

head: two new tests. Improves function coverage from 38 to 75

This commit is contained in:
Jadi 2024-04-05 23:13:37 +03:30 committed by Ben Wiederhake
parent 415de28fed
commit 5d17bf7d78
2 changed files with 27 additions and 0 deletions

View file

@ -438,3 +438,21 @@ fn test_read_backwards_bytes_sys_kernel_profiling() {
assert_eq!(stdout_str.len(), 1);
assert!(stdout_str == "0" || stdout_str == "1");
}
#[test]
fn test_value_too_large() {
const MAX: u64 = u64::MAX;
new_ucmd!()
.args(&["-n", format!("{MAX}0").as_str(), "lorem_ipsum.txt"])
.fails()
.stderr_contains("Value too large for defined data type");
}
#[test]
fn test_all_but_last_lines() {
new_ucmd!()
.args(&["-n", "-15", "lorem_ipsum.txt"])
.succeeds()
.stdout_is_fixture("lorem_ipsum_backwards_15_lines.expected");
}