From 6c4f9c520f7c863966a9eaf04834a7f12d49a9bc Mon Sep 17 00:00:00 2001 From: Paul Fenwick Date: Thu, 2 Jul 2009 23:55:08 +1000 Subject: [PATCH] Upgrade autodie to 2.04 G'day p5p, Sorry about the slew of autodie patches. This is hopefully the last one you'll see for a while, and merely fixes some nits in the test suite. Generated against the latest blead, but there's a chance some of these changes may already be applied. Apologies for any inconvenience caused. All the best, Paul -- Paul Fenwick | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681 From 2ac05f822da3f96c6453dd32570bc76e4a8e1489 Mon Sep 17 00:00:00 2001 From: Paul Fenwick Date: Thu, 2 Jul 2009 23:46:53 +1000 Subject: [PATCH] Upgrade autodie to 2.04 * TEST: Removed spurious warning about insufficient credit. * TEST: hints.t produces less debugging output when testing the Perl core. (Thanks to Jerry D. Hedden) * TEST: hints.t no longer spuriously fails when checking the return values from File::Copy under Windows before Perl 5.10.1. (Thanks to Curtis Jewell) Signed-off-by: H.Merijn Brand --- lib/Fatal.pm | 4 ++-- lib/autodie.pm | 2 +- lib/autodie/exception.pm | 2 +- lib/autodie/exception/system.pm | 2 +- lib/autodie/hints.pm | 2 +- lib/autodie/t/hints.t | 19 ++++++++++++++++--- 6 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/Fatal.pm b/lib/Fatal.pm index e65cc57..be20a2b 100644 --- a/lib/Fatal.pm +++ b/lib/Fatal.pm @@ -39,7 +39,7 @@ use constant ERROR_58_HINTS => q{Non-subroutine %s hints for %s are not supporte use constant MIN_IPC_SYS_SIMPLE_VER => 0.12; # All the Fatal/autodie modules share the same version number. -our $VERSION = '2.03'; +our $VERSION = '2.04'; our $Debug ||= 0; @@ -98,7 +98,7 @@ my %TAGS = ( ':2.01' => [qw(:default)], ':2.02' => [qw(:default)], ':2.03' => [qw(:default)], - + ':2.04' => [qw(:default)], ); $TAGS{':all'} = [ keys %TAGS ]; diff --git a/lib/autodie.pm b/lib/autodie.pm index 72f312e..1f8d7e5 100644 --- a/lib/autodie.pm +++ b/lib/autodie.pm @@ -8,7 +8,7 @@ our @ISA = qw(Fatal); our $VERSION; BEGIN { - $VERSION = '2.03'; + $VERSION = '2.04'; } use constant ERROR_WRONG_FATAL => q{ diff --git a/lib/autodie/exception.pm b/lib/autodie/exception.pm index 364b134..5a09617 100644 --- a/lib/autodie/exception.pm +++ b/lib/autodie/exception.pm @@ -14,7 +14,7 @@ use overload use if ($] >= 5.010), overload => '~~' => "matches"; -our $VERSION = '2.03'; +our $VERSION = '2.04'; my $PACKAGE = __PACKAGE__; # Useful to have a scalar for hash keys. diff --git a/lib/autodie/exception/system.pm b/lib/autodie/exception/system.pm index d7be816..59b2eaf 100644 --- a/lib/autodie/exception/system.pm +++ b/lib/autodie/exception/system.pm @@ -5,7 +5,7 @@ use warnings; use base 'autodie::exception'; use Carp qw(croak); -our $VERSION = '2.03'; +our $VERSION = '2.04'; my $PACKAGE = __PACKAGE__; diff --git a/lib/autodie/hints.pm b/lib/autodie/hints.pm index 71b371a..db22467 100644 --- a/lib/autodie/hints.pm +++ b/lib/autodie/hints.pm @@ -5,7 +5,7 @@ use warnings; use constant PERL58 => ( $] < 5.009 ); -our $VERSION = '2.03'; +our $VERSION = '2.04'; =head1 NAME diff --git a/lib/autodie/t/hints.t b/lib/autodie/t/hints.t index ec1ef32..c21fde5 100755 --- a/lib/autodie/t/hints.t +++ b/lib/autodie/t/hints.t @@ -23,7 +23,7 @@ use Hints_test qw( use autodie qw(fail_on_empty fail_on_false fail_on_undef); diag("Sub::Identify ", exists( $INC{'Sub/Identify.pm'} ) ? "is" : "is not", - " loaded"); + " loaded") if (! $ENV{PERL_CORE}); my $hints = "autodie::hints"; @@ -61,7 +61,14 @@ isnt("$@", "", "Copying in scalar context should throw an error."); isa_ok($@, "autodie::exception"); is($@->function, "File::Copy::copy", "Function should be original name"); -is($@->return, 0, "File::Copy returns zero on failure"); + +SKIP: { + skip("File::Copy is weird on Win32 before 5.10.1", 1) + if ( ! PERL5101 and $^O eq "MSWin32" ); + + is($@->return, 0, "File::Copy returns zero on failure"); +} + is($@->context, "scalar", "File::Copy called in scalar context"); # List context test. @@ -76,7 +83,13 @@ isnt("$@", "", "Copying in list context should throw an error."); isa_ok($@, "autodie::exception"); is($@->function, "File::Copy::copy", "Function should be original name"); -is_deeply($@->return, [0], "File::Copy returns zero on failure"); + +SKIP: { + skip("File::Copy is weird on Win32 before 5.10.1", 1) + if ( ! PERL5101 and $^O eq "MSWin32" ); + + is_deeply($@->return, [0], "File::Copy returns zero on failure"); +} is($@->context, "list", "File::Copy called in list context"); # Tests on loaded funcs. -- 2.7.4