From e376aa0507a6c8d674cc1aa2ed80df470528c8e4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:39 +0100 Subject: [PATCH] tests: tail: ensure a count is validated even when later overridden Reported at https://github.com/uutils/coreutils/issues/15997 * tests/tail/tail.pl: Add test cases. Link: https://github.com/coreutils/coreutils/pull/438 --- tests/tail/tail.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/tail/tail.pl b/tests/tail/tail.pl index abddea084..6ded376fe 100755 --- a/tests/tail/tail.pl +++ b/tests/tail/tail.pl @@ -74,6 +74,12 @@ my @tv = ( ['big-c', '-c99999999999999999999', '', '', 0], +# Ensure a count is validated even when a later option overrides it. +['overridden-c', '-c 1,2 -n 2', "a\n", '', 1, + "$prog: invalid number of bytes: '1,2'\n"], +['overridden-n', '-n 1,2 -c 2', "a\n", '', 1, + "$prog: invalid number of lines: '1,2'\n"], + # Same as -n 10 ['minus-1', '-', '', '', 0], ['minus-2', '-', "x\n" . ("y\n" x 10) . 'z', ("y\n" x 9) . 'z', 0],