From: Pádraig Brady
Date: Fri, 12 Jun 2026 16:15:18 +0000 (+0100) Subject: tests: pr: add more numeric option tests X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fcoreutils.git tests: pr: add more numeric option tests * tests/pr/options.sh: Add tests for -e, -l, -w, -W. --- diff --git a/tests/pr/options.sh b/tests/pr/options.sh index bbd1e8d72..feaf49f19 100755 --- a/tests/pr/options.sh +++ b/tests/pr/options.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Test 'pr' option handling +# Test 'pr' numeric option handling # Copyright (C) 2026 Free Software Foundation, Inc. @@ -22,19 +22,39 @@ getlimits_ # Ensure pr treats all invalid +page ranges as a file for p in +0 +0foo; do - returns_ 1 pr "$p" 2>err err exp || framework_failure_ compare exp err || fail=1 done # number parsing issue -returns_ 1 pr --pages=-0 2>err err exp compare exp err || fail=1 # number validation issue -returns_ 1 pr --pages=0 2>err err exp compare exp err || fail=1 +INV='invalid number' + +returns_ 1 pr -l0 2>err exp || framework_failure_ +compare exp err || fail=1 + +for w in w W; do + returns_ 1 pr -${w}0 2>err exp || framework_failure_ + compare exp err || fail=1 +done + +returns_ 1 pr -e=-1 2>err exp || framework_failure_ +compare exp err || fail=1 + Exit $fail