mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #851 from fitzgen/tests-for-tail-bytes
Tests for `tail -c <bytes>`
This commit is contained in:
commit
e0c21b99c5
3 changed files with 19 additions and 0 deletions
2
tests/fixtures/tail/foobar_bytes_single.expected
vendored
Normal file
2
tests/fixtures/tail/foobar_bytes_single.expected
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
diez
|
||||||
|
once
|
3
tests/fixtures/tail/foobar_bytes_stdin.expected
vendored
Normal file
3
tests/fixtures/tail/foobar_bytes_stdin.expected
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
ve
|
||||||
|
diez
|
||||||
|
once
|
|
@ -57,3 +57,17 @@ fn test_single_big_args() {
|
||||||
assert_eq!(result.stdout, at.read(BIG_EXPECTED));
|
assert_eq!(result.stdout, at.read(BIG_EXPECTED));
|
||||||
cleanup_big_test_files(&at);
|
cleanup_big_test_files(&at);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_bytes_single() {
|
||||||
|
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||||
|
let result = ucmd.arg("-c").arg("10").arg(INPUT).run();
|
||||||
|
assert_eq!(result.stdout, at.read("foobar_bytes_single.expected"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_bytes_stdin() {
|
||||||
|
let (at, mut ucmd) = testing(UTIL_NAME);
|
||||||
|
let result = ucmd.arg("-c").arg("13").run_piped_stdin(at.read(INPUT));
|
||||||
|
assert_eq!(result.stdout, at.read("foobar_bytes_stdin.expected"));
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue