From: Pádraig Brady
Date: Thu, 9 Apr 2026 14:32:29 +0000 (+0100) Subject: tests: tty-eof.pl: make fully table driven X-Git-Tag: v9.11~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=574d8660c72e27f43d32870a80736e84730dd8fe;p=thirdparty%2Fcoreutils.git tests: tty-eof.pl: make fully table driven * tests/tty/tty-eof.pl: Remove command specific logic, and adjust commands to support general input. Also add cut -b, as cut_bytes has its own read loop. --- diff --git a/tests/tty/tty-eof.pl b/tests/tty/tty-eof.pl index 7cac3b5e2f..4820dafe8f 100755 --- a/tests/tty/tty-eof.pl +++ b/tests/tty/tty-eof.pl @@ -36,7 +36,6 @@ $@ base64 cat cksum - dd expand fmt fold @@ -63,8 +62,13 @@ $@ uniq wc ); - my @commands = (@stdin_reading_commands, 'basenc --z85', 'cut -f2', - 'numfmt --invalid=ignore'); + my @commands = (@stdin_reading_commands, + 'basenc --z85', + 'cut -d " " -f2', + 'cut -b1-3', + 'dd status=none', + 'numfmt --invalid=ignore' + ); my $stderr = 'tty-eof.err'; foreach my $with_input (1, 0) { @@ -82,7 +86,7 @@ $@ my $found; if ($with_input) { - my $input = $cmd =~ /^cut/ ? "a\tb\n" : "a b\n"; + my $input = "a b\n"; my $echo = quotemeta $input; $echo =~ s/\n$//; @@ -112,10 +116,6 @@ $@ $fail=1; $exp->hard_close(); - # dd normally writes to stderr. If it exits successfully, we're done. - $cmd eq 'dd' && $s == 0 - and next; - if (-s $stderr) { warn "$ME: $cmd wrote to stderr ($mode):\n";