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

tail: add fixes to pass "gnu/tests/tail-2/tail-c.sh" from GNU's test suite

This commit is contained in:
Jan Scheer 2021-09-08 02:09:09 +02:00
parent ff5607c363
commit cd0d23752a
No known key found for this signature in database
GPG key ID: C62AD4C29E2B9828
2 changed files with 38 additions and 2 deletions

View file

@ -425,3 +425,23 @@ fn test_tail_num_with_undocumented_sign_bytes() {
.succeeds()
.stdout_is("efghijklmnopqrstuvwxyz");
}
#[test]
#[cfg(unix)]
fn test_tail_bytes_for_funny_files() {
// gnu/tests/tail-2/tail-c.sh
let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
for &file in &["/proc/version", "/sys/kernel/profiling"] {
if !at.file_exists(file) {
continue;
}
let args = ["--bytes", "1", file];
let result = ts.ucmd().args(&args).run();
let exp_result = unwrap_or_return!(expected_result(&ts, &args));
result
.stdout_is(exp_result.stdout_str())
.stderr_is(exp_result.stderr_str())
.code_is(exp_result.code());
}
}