tests: ls: check a too long file name is reported as "cannot access"

* tests/ls/ls-misc.pl (name-too-long): New test.
https://github.com/uutils/coreutils/pull/15699

Link: https://github.com/coreutils/coreutils/pull/456
This commit is contained in:
Sylvestre Ledru authored and Pádraig Brady committed 2026-11-09 00:24:53 +00:00
1 parent 64ea3f0553
commit 40d9fe3e03
1 file changed
+11 -1
+11 -1
View File
@@ -361,7 +361,17 @@ my @Tests =
{ERR => "$prog: invalid --block-size argument '0'\n"},
{EXIT => 2},
] } ('', '--si', '-h')),
);
# A file name component that is too long is reported like any other
# file that cannot be accessed. ERR_SUBST avoids false ENOENT failures
# where the long name might be allowed.
do { my $long = 'x' x 1000;
['name-too-long', $long,
{ERR_SUBST=>"s/'$long':.*/'$long':/"},
{ERR => "$prog: cannot access '$long':\n"},
{EXIT => 2},
] },
);
umask 022;