From: Vincent Pit Date: Sun, 29 Jun 2008 16:24:23 +0000 (+0200) Subject: Importing Variable-Magic-0.05.tar.gz X-Git-Tag: v0.05 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=refs%2Ftags%2Fv0.05;p=perl%2Fmodules%2FVariable-Magic.git Importing Variable-Magic-0.05.tar.gz --- diff --git a/Changes b/Changes index d5a8d09..171ac4f 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,8 @@ Revision history for Variable-Magic +0.05 2007-11-19 09:10 UTC + + Fix : 5.10.0_RC1 compatibility fix. + 0.04 2007-08-28 12:25 UTC + Chg : s/require (XSLoader)/use $1/. + Fix : Tests are now strict. diff --git a/META.yml b/META.yml index b0a9eb4..c70ad14 100644 --- a/META.yml +++ b/META.yml @@ -1,9 +1,9 @@ --- #YAML:1.0 name: Variable-Magic -version: 0.04 +version: 0.05 abstract: Associate user-defined magic to variables from Perl. license: perl -generated_by: ExtUtils::MakeMaker version 6.36 +generated_by: ExtUtils::MakeMaker version 6.36_01 distribution_type: module requires: Carp: 0 diff --git a/Magic.xs b/Magic.xs index 14874e1..89c8351 100644 --- a/Magic.xs +++ b/Magic.xs @@ -273,7 +273,7 @@ STATIC int vmg_wizard_free(pTHX_ SV *wiz, MAGIC *mg) { w = SV2MGWIZ(wiz); SvREFCNT_inc(wiz); /* Fake survival - it's gonna be deleted anyway */ -#if PERL_API_REVISION >= 5 && PERL_API_VERSION >= 9 && PERL_API_SUBVERSION >= 5 +#if PERL_API_REVISION > 5 || (PERL_API_REVISION == 5 && (PERL_API_VERSION > 9 || (PERL_API_VERSION == 9 && PERL_API_SUBVERSION >= 5))) SvREFCNT_inc(wiz); /* One more push */ #endif if (hv_delete(MY_CXT.wizz, buf, sprintf(buf, "%u", w->sig), 0)) { diff --git a/README b/README index 281f3dc..cec74c1 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Variable::Magic - Associate user-defined magic to variables from Perl. VERSION - Version 0.04 + Version 0.05 SYNOPSIS use Variable::Magic qw/wizard cast dispell/; diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index 7289d6e..d33c37b 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -11,11 +11,11 @@ Variable::Magic - Associate user-defined magic to variables from Perl. =head1 VERSION -Version 0.04 +Version 0.05 =cut -our $VERSION = '0.04'; +our $VERSION = '0.05'; =head1 SYNOPSIS diff --git a/samples/magic.pl b/samples/magic.pl index 1439e2d..7411744 100755 --- a/samples/magic.pl +++ b/samples/magic.pl @@ -14,7 +14,7 @@ my $sig; { my $wiz = wizard get => \&foo, set => $bar, - free => sub { print STDERR "deleted!\n"; }; + free => sub { print STDERR "deleted!\n"; }; $sig = getsig $wiz; print "my sig is $sig\n"; cast $a, $wiz, qw/a b c/; diff --git a/t/10-simple.t b/t/10-simple.t index a5d0917..99136bd 100644 --- a/t/10-simple.t +++ b/t/10-simple.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 16; use Variable::Magic qw/wizard gensig getsig cast dispell/; @@ -32,6 +32,10 @@ $res = eval { dispell $a, $wiz }; ok(!$@, "re-dispell croaks ($@)"); ok($res, 're-dispell invalid'); +$res = eval { dispell my $b, $wiz }; +ok(!$@, "dispell non-magic object fails ($@)"); +ok($res == 0, 'dispell non-magic object doesn\'t return 0'); + $sig = gensig; { my $wiz = wizard sig => $sig;