summaryrefslogtreecommitdiff
path: root/lib/Term
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-10-04 03:00:03 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-10-04 03:00:03 +0000
commitd78106c0605755e51c4b67241a697a8bcbc5a54d (patch)
tree8be813d7a48ba94eb044c5b71f50ce58266c042a /lib/Term
parentc0242f0e656bc89dca7727837855678663c6f452 (diff)
downloadperl-d78106c0605755e51c4b67241a697a8bcbc5a54d.tar.gz
Restore only if something to restore.
p4raw-id: //depot/perl@12332
Diffstat (limited to 'lib/Term')
-rw-r--r--lib/Term/Complete.t6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Term/Complete.t b/lib/Term/Complete.t
index 63b2825b7a..2e83971615 100644
--- a/lib/Term/Complete.t
+++ b/lib/Term/Complete.t
@@ -10,7 +10,6 @@ use Test::More tests => 8;
use vars qw( $Term::Complete::complete $complete );
my $restore;
-
SKIP: {
skip('PERL_SKIP_TTY_TEST', 8) if $ENV{PERL_SKIP_TTY_TEST};
@@ -22,7 +21,7 @@ SKIP: {
skip("$TTY not a tty", 8) if defined $TTY && ! -t TTY;
$restore = `stty -g`;
skip("Can't reliably restore $TTY", 8) if $?;
- }
+ }
use_ok( 'Term::Complete' );
@@ -69,7 +68,8 @@ like( $$out, qr/prompt:frobn/, 'prompt is okay' );
# now remove the prompt and we should be okay
$$out =~ s/prompt://g;
is( $$out, get_expected('frobn', 'frobnitz' ), 'works with new $complete' );
-`stty $restore`;
+
+`stty $restore` if defined $restore;
} # end of SKIP, end of tests