From 5d793a1521fedfca05a954eb84658354e69b511d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:39 +0100 Subject: [PATCH] tests: nl: ensure nl accepts negative -v and -i values Reported at https://github.com/uutils/coreutils/issues/15999 * tests/nl/nl.sh: Add test cases. Link: https://github.com/coreutils/coreutils/pull/426 --- tests/nl/nl.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/nl/nl.sh b/tests/nl/nl.sh index c36047270..d4354d708 100755 --- a/tests/nl/nl.sh +++ b/tests/nl/nl.sh @@ -142,4 +142,13 @@ printf ' 1\ta\n \n 2\tb\n \n 3\tc\n' >exp \ compare exp out || fail=1 compare /dev/null err || fail=1 +# Negative -v and -i values are accepted. +printf 'a\nb\n' > inp || framework_failure_ +nl -v -1 inp > out || fail=1 +printf ' -1\ta\n 0\tb\n' > exp || framework_failure_ +compare exp out || fail=1 +nl -v 5 -i -1 inp > out || fail=1 +printf ' 5\ta\n 4\tb\n' > exp || framework_failure_ +compare exp out || fail=1 + Exit $fail