diff --git a/tests/fixtures/tail/foobar_bytes_single.expected b/tests/fixtures/tail/foobar_bytes_single.expected new file mode 100644 index 000000000..eca784d72 --- /dev/null +++ b/tests/fixtures/tail/foobar_bytes_single.expected @@ -0,0 +1,2 @@ +diez +once diff --git a/tests/fixtures/tail/foobar_bytes_stdin.expected b/tests/fixtures/tail/foobar_bytes_stdin.expected new file mode 100644 index 000000000..c6c34e9a1 --- /dev/null +++ b/tests/fixtures/tail/foobar_bytes_stdin.expected @@ -0,0 +1,3 @@ +ve +diez +once diff --git a/tests/tail.rs b/tests/tail.rs index b83f8848e..7d53bede1 100644 --- a/tests/tail.rs +++ b/tests/tail.rs @@ -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")); +}