]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: ls: check that an invalid --tabsize is diagnosed
authorSylvestre Ledru <sylvestre@debian.org>
Sat, 4 Jul 2026 19:15:00 +0000 (21:15 +0200)
committerPádraig Brady <P@draigBrady.com>
Mon, 6 Jul 2026 13:23:58 +0000 (14:23 +0100)
* tests/ls/ls-misc.pl: Add tests, generated by a loop over invalid
values, verifying that a negative (-9), non-numeric (zz), or
fractional (0.5) --tabsize argument is rejected with
"invalid tab size" and exit status 2.
https://github.com/uutils/coreutils/pull/13278

Link: https://github.com/coreutils/coreutils/pull/311
tests/ls/ls-misc.pl

index 4a22e35f40b28f585c4cf87c075e25fd6f2e85b5..806f2ec04028b6e66a8f4b1b8cd5a67d1d590d1d 100755 (executable)
@@ -349,6 +349,12 @@ my @Tests =
       $rmdir_reg,
       {EXIT => 2},
      ],
+
+     # Negative, non-numeric and fractional --tabsize values are invalid.
+     (map { ["tabsize-invalid-$_", "--tabsize=$_",
+             {ERR => "$prog: invalid tab size: '$_'\n"},
+             {EXIT => 2},
+            ] } qw(-9 zz 0.5)),
     );
 
 umask 022;