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

tail: use functionality from uucore::error where applicable

* minor code clean-up
* remove test-suite summary from README
This commit is contained in:
Jan Scheer 2022-06-06 14:36:51 +02:00
parent e0efd6cc90
commit beb2b7cf5e
No known key found for this signature in database
GPG key ID: C62AD4C29E2B9828
4 changed files with 102 additions and 127 deletions

View file

@ -997,21 +997,25 @@ fn test_invalid_num() {
new_ucmd!()
.args(&["-c", "1024R", "emptyfile.txt"])
.fails()
.stderr_is("tail: invalid number of bytes: '1024R'");
.stderr_str()
.starts_with("tail: invalid number of bytes: '1024R'");
new_ucmd!()
.args(&["-n", "1024R", "emptyfile.txt"])
.fails()
.stderr_is("tail: invalid number of lines: '1024R'");
.stderr_str()
.starts_with("tail: invalid number of lines: '1024R'");
#[cfg(not(target_pointer_width = "128"))]
new_ucmd!()
.args(&["-c", "1Y", "emptyfile.txt"])
.fails()
.stderr_is("tail: invalid number of bytes: '1Y': Value too large for defined data type");
.stderr_str()
.starts_with("tail: invalid number of bytes: '1Y': Value too large for defined data type");
#[cfg(not(target_pointer_width = "128"))]
new_ucmd!()
.args(&["-n", "1Y", "emptyfile.txt"])
.fails()
.stderr_is("tail: invalid number of lines: '1Y': Value too large for defined data type");
.stderr_str()
.starts_with("tail: invalid number of lines: '1Y': Value too large for defined data type");
#[cfg(target_pointer_width = "32")]
{
let sizes = ["1000G", "10T"];
@ -1020,13 +1024,15 @@ fn test_invalid_num() {
.args(&["-c", size])
.fails()
.code_is(1)
.stderr_only("tail: Insufficient addressable memory");
.stderr_str()
.starts_with("tail: Insufficient addressable memory");
}
}
new_ucmd!()
.args(&["-c", ""])
.fails()
.stderr_is("tail: invalid number of bytes: '³'");
.stderr_str()
.starts_with("tail: invalid number of bytes: '³'");
}
#[test]