From: Artur Bergman Date: Sat, 8 Jun 2002 19:42:33 +0000 (+0000) Subject: Prepare CPAN release of Attribute::Handlers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=448fed509a7762f7e1ddb3ec250ba650f491e076;p=p5sagit%2Fp5-mst-13.2.git Prepare CPAN release of Attribute::Handlers Make the test case know about the changes in attributes in 5.8 (lexical) and also turn off some warnings. p4raw-id: //depot/perl@17112 --- diff --git a/lib/Attribute/Handlers.pm b/lib/Attribute/Handlers.pm index 3afccd5..ef67a3d 100644 --- a/lib/Attribute/Handlers.pm +++ b/lib/Attribute/Handlers.pm @@ -2,7 +2,7 @@ package Attribute::Handlers; use 5.006; use Carp; use warnings; -$VERSION = '0.76'; +$VERSION = '0.77'; # $DB::single=1; my %symcache; diff --git a/lib/Attribute/Handlers/t/multi.t b/lib/Attribute/Handlers/t/multi.t index 7bcb284..4cb4992 100644 --- a/lib/Attribute/Handlers/t/multi.t +++ b/lib/Attribute/Handlers/t/multi.t @@ -149,19 +149,22 @@ ok( $out eq "begin\nbye\nbye\n", 46 ); sub dummy { my $dummy : Dummy; } $applied = 0; dummy(); dummy(); +if($] < 5.008) { +ok(1, "47 # skip does not work with perl prior to 5.8"); +} else { ok( $applied == 2, 47 ); - +} # 45-47 again, but for our variables $out = "begin\n"; { our $dummy; $dummy = bless {}, 'Dummy'; } ok( $out eq "begin\n", 48 ); -{ our $dummy : Dummy; $dummy = bless {}, 'Dummy'; } +{ no warnings; our $dummy : Dummy; $dummy = bless {}, 'Dummy'; } ok( $out eq "begin\nbye\n", 49 ); undef $::dummy; ok( $out eq "begin\nbye\nbye\n", 50 ); # are lexical attributes reapplied correctly? -sub dummy_our { our $banjo : Dummy; } +sub dummy_our { no warnings; our $banjo : Dummy; } $applied = 0; dummy_our(); dummy_our(); ok( $applied == 0, 51 ); @@ -172,4 +175,9 @@ eval { my $groucho : Stooge; }; my $match = $@ =~ /^Won't be able to apply END handler/; +if($] < 5.008) { +ok(1,"52 # Skip, no difference between lexical handlers and normal handlers prior to 5.8"); +} else { ok( $match, 52 ); +} +