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
This commit is contained in:
Sylvestre Ledru authored and Pádraig Brady committed 2026-11-07 12:35:10 +00:00
1 parent 42a8f28c00
commit e376aa0507
1 file changed
+6
+6
View File
@@ -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],