From: Jarkko Hietaniemi Date: Thu, 4 Oct 2001 03:00:03 +0000 (+0000) Subject: Restore only if something to restore. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d78106c0605755e51c4b67241a697a8bcbc5a54d;p=p5sagit%2Fp5-mst-13.2.git Restore only if something to restore. p4raw-id: //depot/perl@12332 --- diff --git a/lib/Term/Complete.t b/lib/Term/Complete.t index 63b2825..2e83971 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