From bb0ffe17f7246496c6792dd0c794713fcf42e43d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 29 Oct 2026 21:30:39 +0100 Subject: [PATCH] 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 --- tests/paste/paste.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/paste/paste.pl b/tests/paste/paste.pl index 3a1be1781..98542f862 100755 --- a/tests/paste/paste.pl +++ b/tests/paste/paste.pl @@ -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};