diff options
author | chromatic <chromatic@wgz.org> | 2001-10-07 10:59:26 -0600 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-08 11:56:49 +0000 |
commit | 094a1794f4560f29b651b3d8550b3c39b3111eef (patch) | |
tree | 6b7f8627a8e9d28986add9f5b3b878a6113518d8 /lib/Term | |
parent | ebce15be89d40bc94316700ed943f1c712c6b9cd (diff) | |
download | perl-094a1794f4560f29b651b3d8550b3c39b3111eef.tar.gz |
Re: [PATCH] & what's to be done for 5.8.0?
Message-ID: <20011007230518.90917.qmail@onion.perl.org>
p4raw-id: //depot/perl@12358
Diffstat (limited to 'lib/Term')
-rw-r--r-- | lib/Term/Cap.t | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/Term/Cap.t b/lib/Term/Cap.t index f3da8c93e9..bceba75182 100644 --- a/lib/Term/Cap.t +++ b/lib/Term/Cap.t @@ -1,6 +1,8 @@ #!./perl +my $file; BEGIN { + $file = $0; chdir 't' if -d 't'; @INC = '../lib'; } @@ -34,14 +36,14 @@ is( $path, $files, 'termcap_path() should find default files' ); SKIP: { # this is ugly, but -f $0 really *ought* to work - skip("-f $0 fails, some tests difficult now", 2) unless -f $0; + skip("-f $file fails, some tests difficult now", 2) unless -f $file; - $ENV{TERMCAP} = $ENV{TERMPATH} = $0; - ok( grep($0, Term::Cap::termcap_path()), + $ENV{TERMCAP} = $ENV{TERMPATH} = $file; + ok( grep($file, Term::Cap::termcap_path()), 'termcap_path() should find file from $ENV{TERMCAP}' ); $ENV{TERMCAP} = (grep { $^O eq $_ } qw( os2 MSWin32 dos )) ? 'a:/' : '/'; - ok( grep($0, Term::Cap::termcap_path()), + ok( grep($file, Term::Cap::termcap_path()), 'termcap_path() should find file from $ENV{TERMPATH}' ); } @@ -100,11 +102,13 @@ $ENV{TERMCAP} = ''; eval { $t = Term::Cap->Tgetent($vals) }; isn't( $@, '', 'Tgetent() should catch bad termcap file' ); -# if there's no valid termcap file found, it should croak +# if there's no valid termcap file found, it should croak +# (an empty string in $ENV{TERMPATH} and $ENV{TERM} counts as 'not found') $vals->{TERM} = ''; -$ENV{TERMPATH} = $0; +$ENV{TERMPATH} = ''; +$ENV{TERMCAP} = '|:'; eval { $t = Term::Cap->Tgetent($vals) }; -like( $@, qr/failed termcap lookup/, 'Tgetent() should dies with bad termcap' ); +like( $@, qr/failed termcap lookup/, 'Tgetent() should die with bad termcap' ); SKIP: { skip( "Can't write 'tcout' file for tests", 8 ) unless $writable; |