summaryrefslogtreecommitdiff
path: root/lib/Term/Cap.t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-10-19 10:18:19 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-10-19 10:18:19 +0000
commit085f5cc492ea5e5475e996a3aeb2a2cd13f949a5 (patch)
treed422c916c782f5a46a3063d0d63cdf16d53b4a56 /lib/Term/Cap.t
parent7776bb98baa352bc70e2eb4041c0d2aa9723669c (diff)
downloadperl-085f5cc492ea5e5475e996a3aeb2a2cd13f949a5.tar.gz
Upgrade to Term::Cap 1.10
p4raw-id: //depot/perl@32143
Diffstat (limited to 'lib/Term/Cap.t')
-rw-r--r--lib/Term/Cap.t27
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/Term/Cap.t b/lib/Term/Cap.t
index 0ea537dcdf..08f042ec57 100644
--- a/lib/Term/Cap.t
+++ b/lib/Term/Cap.t
@@ -24,11 +24,11 @@ my $files = join '',
( $ENV{HOME} . '/.termcap', # we assume pretty UNIXy system anyway
'/etc/termcap',
'/usr/share/misc/termcap' );
-unless( $files || $^O eq 'VMS') {
+unless( $files || $^O eq 'VMS' ) {
plan skip_all => 'no termcap available to test';
}
else {
- plan tests => 44;
+ plan tests => 45;
}
use_ok( 'Term::Cap' );
@@ -158,6 +158,17 @@ SKIP: {
is( $t->{_bc}, "\b", 'should set _bc field correctly' );
}
+# Windows hack
+{
+ local *^O;
+ local *ENV;
+ delete $ENV{TERM};
+ $^O = 'Win32';
+
+ my $foo = Term::Cap->Tgetent();
+ is($foo->{TERM} ,'dumb','Windows gets "dumb" by default');
+}
+
# Tgoto has comments on the expected formats
$t->{_test} = "a%d";
is( $t->Tgoto('test', '', 1, *OUT), 'a1', 'Tgoto() should handle %d code' );
@@ -166,12 +177,12 @@ is( $out->read(), 'a1', 'Tgoto() should print to filehandle if passed' );
$t->{_test} = "a%.";
like( $t->Tgoto('test', '', 1), qr/^a\x01/, 'Tgoto() should handle %.' );
if (ord('A') == 193) { # EBCDIC platform
-like( $t->Tgoto('test', '', 0), qr/\x81\x01\x16/,
- 'Tgoto() should handle %. and magic' );
-} else { # ASCII platform
-like( $t->Tgoto('test', '', 0), qr/\x61\x01\x08/,
- 'Tgoto() should handle %. and magic' );
-}
+ like( $t->Tgoto('test', '', 0), qr/\x81\x01\x16/,
+ 'Tgoto() should handle %. and magic' );
+ } else { # ASCII platform
+ like( $t->Tgoto('test', '', 0), qr/\x61\x01\x08/,
+ 'Tgoto() should handle %. and magic' );
+ }
$t->{_test} = 'a%+';
like( $t->Tgoto('test', '', 1), qr/a\x01/, 'Tgoto() should handle %+' );