From 0d281cf88632d0ba11042160f776f80311931176 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Sun, 27 Mar 2016 14:42:45 -0700 Subject: [PATCH] tests/tail: Test when `-n` is larger than the number of lines in the file --- tests/tail.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/tail.rs b/tests/tail.rs index d8045284a..ab4abaccd 100644 --- a/tests/tail.rs +++ b/tests/tail.rs @@ -23,6 +23,13 @@ fn test_single_default() { assert_eq!(result.stdout, at.read("foobar_single_default.expected")); } +#[test] +fn test_n_greater_than_number_of_lines() { + let (at, mut ucmd) = testing(UTIL_NAME); + let result = ucmd.arg("-n").arg("99999999").arg(FOOBAR_TXT).run(); + assert_eq!(result.stdout, at.read(FOOBAR_TXT)); +} + #[test] fn test_single_big_args() { const FILE: &'static str = "single_big_args.txt";