tests: paste: ensure paste names the file in open and read errors

Reported at https://github.com/uutils/coreutils/issues/15983

* tests/paste/paste.pl: Add test cases.

Link: https://github.com/coreutils/coreutils/pull/430
This commit is contained in:
Sylvestre Ledru authored and Pádraig Brady committed 2026-11-07 12:35:10 +00:00
1 parent 30f5713ede
commit bb0ffe17f7
1 file changed
+7
+7
View File
@@ -24,6 +24,7 @@ use strict;
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
my $prog = 'paste';
my $limits = getlimits ();
my $msg = "$prog: delimiter list ends with an unescaped backslash: ";
my @Tests =
@@ -85,6 +86,12 @@ my @Tests =
['delim-esc-r', q{-s -d '\r'}, {IN=>"1\n2\n"}, {OUT=>"1\r2\n"}],
['delim-esc-v', q{-s -d '\v'}, {IN=>"1\n2\n"}, {OUT=>"1\0132\n"}],
['delim-esc-foo', q{-s -d '\q'}, {IN=>"1\n2\n"}, {OUT=>"1q2\n"}],
# Ensure the file name is diagnosed on open and read errors.
['err-name-read', {IN=>"a\n"}, '.', {OUT=>"a\t\n"}, {EXIT=>1},
{ERR=>"$prog: .: $limits->{EISDIR}\n"}],
['err-name-open', '-s missing', {EXIT=>1},
{ERR=>"$prog: missing: $limits->{ENOENT}\n"}],
);
my $save_temps = $ENV{DEBUG};