From: Steve Peters Date: Fri, 23 Mar 2007 03:36:47 +0000 (+0000) Subject: Upgrade to Test-Simple-0.70 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0753bcb52ae66039875d495707a7475aa37e80f7;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Test-Simple-0.70 p4raw-id: //depot/perl@30711 --- diff --git a/lib/Test/Builder.pm b/lib/Test/Builder.pm index b837496..ee7f8d3 100644 --- a/lib/Test/Builder.pm +++ b/lib/Test/Builder.pm @@ -8,7 +8,7 @@ $^C ||= 0; use strict; use vars qw($VERSION); -$VERSION = '0.68'; +$VERSION = '0.70'; $VERSION = eval $VERSION; # make the alpha version come out as a number # Make Test::Builder thread-safe for ithreads. @@ -1025,10 +1025,10 @@ sub is_fh { my $maybe_fh = shift; return 0 unless defined $maybe_fh; - return 1 if ref \$maybe_fh eq 'GLOB'; # its a glob + return 1 if ref $maybe_fh eq 'GLOB'; # its a glob + return 1 if ref \$maybe_fh eq 'GLOB'; # its a glob ref - return eval { $maybe_fh->isa("GLOB") } || - eval { $maybe_fh->isa("IO::Handle") } || + return eval { $maybe_fh->isa("IO::Handle") } || # 5.5.4's tied() and can() doesn't like getting undef eval { (tied($maybe_fh) || '')->can('TIEHANDLE') }; } diff --git a/lib/Test/More.pm b/lib/Test/More.pm index 7a2c2aa..376726c 100644 --- a/lib/Test/More.pm +++ b/lib/Test/More.pm @@ -16,7 +16,7 @@ sub _carp { use vars qw($VERSION @ISA @EXPORT %EXPORT_TAGS $TODO); -$VERSION = '0.68'; +$VERSION = '0.70'; $VERSION = eval $VERSION; # make the alpha version come out as a number use Test::Builder::Module; diff --git a/lib/Test/Simple.pm b/lib/Test/Simple.pm index 16922e6..4d35a0d 100644 --- a/lib/Test/Simple.pm +++ b/lib/Test/Simple.pm @@ -4,7 +4,7 @@ use 5.004; use strict 'vars'; use vars qw($VERSION @ISA @EXPORT); -$VERSION = '0.68'; +$VERSION = '0.70'; $VERSION = eval $VERSION; # make the alpha version come out as a number use Test::Builder::Module; diff --git a/lib/Test/Simple/Changes b/lib/Test/Simple/Changes index c7c0c55..f759c94 100644 --- a/lib/Test/Simple/Changes +++ b/lib/Test/Simple/Changes @@ -1,3 +1,13 @@ +0.70 Thu Mar 15 15:53:05 PDT 2007 + Bug Fixes + * The change to is_fh() in 0.68 broke the case where a reference to + a tied filehandle is used for perl 5.6 and back. This made the tests + puke their guts out. + +0.69 Wed Mar 14 06:43:35 PDT 2007 + Test fixes + - Minor filename compatibility fix to t/fail-more.t [rt.cpan.org 25428] + 0.68 Tue Mar 13 17:27:26 PDT 2007 Bug fixes * If your code has a $SIG{__DIE__} handler in some cases functions like diff --git a/lib/Test/Simple/t/is_fh.t b/lib/Test/Simple/t/is_fh.t index e12af92..f4b1531 100644 --- a/lib/Test/Simple/t/is_fh.t +++ b/lib/Test/Simple/t/is_fh.t @@ -11,7 +11,7 @@ BEGIN { } use strict; -use Test::More tests => 8; +use Test::More tests => 10; use TieOut; ok( !Test::Builder->is_fh("foo"), 'string is not a filehandle' ); @@ -27,3 +27,10 @@ ok( Test::Builder->is_fh(*FILE{IO}) ); tie *OUT, 'TieOut'; ok( Test::Builder->is_fh(*OUT) ); +ok( Test::Builder->is_fh(\*OUT) ); + +SKIP: { + skip "*TIED_HANDLE{IO} doesn't work in this perl", 1 + unless defined *OUT{IO}; + ok( Test::Builder->is_fh(*OUT{IO}) ); +}