1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-08-05 08:10:15 +02:00

Add a test for the above fix.

`cut -f2' would read after EOF.
This commit is contained in:
Jim Meyering
2003-08-02 19:41:28 +00:00
parent ca78a418b2
commit 40944ce6ce
+4 -2
View File
@@ -30,13 +30,15 @@ $@ and (warn "$ME: this script requires Perl's Expect package >=1.11\n"),
my $fail = 0;
foreach my $cmd (qw( cat cksum dd expand fmt fold head md5sum nl od
paste pr ptx sha1sum sort sum tac tee tail tsort
unexpand uniq wc ))
unexpand uniq wc ), 'cut -f2')
{
my $exp = new Expect;
$exp->log_user(0);
$exp->spawn($cmd)
or (warn "$ME: cannot run `$cmd': $!\n"), $fail=1, next;
$exp->send("a b\n");
# No input for cut -f2.
$cmd =~ /^cut/
or $exp->send("a b\n");
$exp->send(''); # FIXME: it'd be better not to hard-code ^D here
$exp->expect (0, '-re', "^a b\\r?\$");
my $found = $exp->expect (1, '-re', "^.+\$");