Merge pull request #851 from fitzgen/tests-for-tail-bytes

Tests for `tail -c <bytes>`
This commit is contained in:
Joseph Crail 2016-03-26 18:38:41 -04:00
commit e0c21b99c5
3 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,2 @@
diez
once

View file

@ -0,0 +1,3 @@
ve
diez
once

View file

@ -57,3 +57,17 @@ fn test_single_big_args() {
assert_eq!(result.stdout, at.read(BIG_EXPECTED));
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"));
}