summaryrefslogtreecommitdiff
path: root/tests/misc/tty-eof
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/tty-eof')
-rwxr-xr-xtests/misc/tty-eof30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/misc/tty-eof b/tests/misc/tty-eof
index ee33864d9..13ddbc8a3 100755
--- a/tests/misc/tty-eof
+++ b/tests/misc/tty-eof
@@ -67,10 +67,10 @@ $@ and (warn "$ME: this script requires Perl's Expect package >=1.11\n"),
my $exp = new Expect;
$exp->log_user(0);
$exp->spawn("$cmd 2> $stderr")
- or (warn "$ME: cannot run `$cmd': $!\n"), $fail=1, next;
+ or (warn "$ME: cannot run `$cmd': $!\n"), $fail=1, next;
# No input for cut -f2.
$cmd =~ /^cut/
- or $exp->send("a b\n");
+ or $exp->send("a b\n");
$exp->send("\cD"); # This is Control-D. FIXME: what if that's not EOF?
$exp->expect (0, '-re', "^a b\\r?\$");
my $found = $exp->expect (1, '-re', "^.+\$");
@@ -78,32 +78,32 @@ $@ and (warn "$ME: this script requires Perl's Expect package >=1.11\n"),
$exp->expect(1, 'eof');
# Expect no output from cut, since we gave it no input.
defined $found || $cmd =~ /^cut/
- or (warn "$ME: $cmd didn't produce expected output\n"),
- $fail=1, next;
+ or (warn "$ME: $cmd didn't produce expected output\n"),
+ $fail=1, next;
defined $exp->exitstatus
- or (warn "$ME: $cmd didn't exit after ^D from standard input\n"),
- $fail=1, next;
+ or (warn "$ME: $cmd didn't exit after ^D from standard input\n"),
+ $fail=1, next;
my $s = $exp->exitstatus;
$s == 0
- or (warn "$ME: $cmd exited with status $s (expected 0)\n"),
- $fail=1;
+ or (warn "$ME: $cmd exited with status $s (expected 0)\n"),
+ $fail=1;
$exp->hard_close();
# dd normally writes to stderr. If it exits successfully, we're done.
$cmd eq 'dd' && $s == 0
- and next;
+ and next;
if (-s $stderr)
- {
- warn "$ME: $cmd wrote to stderr:\n";
- system "cat $stderr";
- $fail = 1;
- }
+ {
+ warn "$ME: $cmd wrote to stderr:\n";
+ system "cat $stderr";
+ $fail = 1;
+ }
}
continue
{
unlink $stderr
- or warn "$ME: failed to remove stderr file from $cmd, $stderr: $!\n";
+ or warn "$ME: failed to remove stderr file from $cmd, $stderr: $!\n";
}
exit $fail