From 9824bc4db30768d4e3baa0d3a6f2c59609a8ef91 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Sat, 26 Mar 2016 11:56:00 -0700 Subject: [PATCH] Add a test for `tail -c ` from stdin --- tests/fixtures/tail/foobar_bytes_stdin.expected | 3 +++ tests/tail.rs | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 tests/fixtures/tail/foobar_bytes_stdin.expected 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 08aba8a95..7d53bede1 100644 --- a/tests/tail.rs +++ b/tests/tail.rs @@ -64,3 +64,10 @@ fn test_bytes_single() { 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")); +}