From: Vincent Pit Date: Sun, 29 Jun 2008 16:24:21 +0000 (+0200) Subject: Importing Variable-Magic-0.04.tar.gz X-Git-Tag: v0.04^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=14f66d40970bef63105be046a109c1a32859a8a0;p=perl%2Fmodules%2FVariable-Magic.git Importing Variable-Magic-0.04.tar.gz --- diff --git a/Changes b/Changes index 9bc0f25..d5a8d09 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Revision history for Variable-Magic +0.04 2007-08-28 12:25 UTC + + Chg : s/require (XSLoader)/use $1/. + + Fix : Tests are now strict. + + Fix : Complete dependencies. + 0.03 2007-08-01 17:20 UTC + Add : Passing the signature of an already defined magic to wizard() now returns the corresponding magic object. diff --git a/META.yml b/META.yml index 012aebd..b0a9eb4 100644 --- a/META.yml +++ b/META.yml @@ -1,13 +1,15 @@ --- #YAML:1.0 name: Variable-Magic -version: 0.03 +version: 0.04 abstract: Associate user-defined magic to variables from Perl. license: perl generated_by: ExtUtils::MakeMaker version 6.36 distribution_type: module requires: Carp: 0 + Exporter: 0 Test::More: 0 + XSLoader: 0 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.2.html version: 1.2 diff --git a/Makefile.PL b/Makefile.PL index d754ae3..f287121 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -10,8 +10,10 @@ WriteMakefile( ABSTRACT_FROM => 'lib/Variable/Magic.pm', PL_FILES => {}, PREREQ_PM => { - 'Carp' => 0, - 'Test::More' => 0 + 'Carp' => 0, + 'Exporter' => 0, + 'Test::More' => 0, + 'XSLoader' => 0 }, dist => { PREOP => 'pod2text lib/Variable/Magic.pm > $(DISTVNAME)/README', diff --git a/README b/README index 6f8f6b0..281f3dc 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Variable::Magic - Associate user-defined magic to variables from Perl. VERSION - Version 0.03 + Version 0.04 SYNOPSIS use Variable::Magic qw/wizard cast dispell/; @@ -175,7 +175,7 @@ EXPORT DEPENDENCIES Carp (standard since perl 5), XSLoader (standard since perl 5.006). - Tests use Symbol (standard since perl 5.002). + Glob tests need Symbol (standard since perl 5.002). SEE ALSO perlguts and perlapi for internal information about magic. diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index 74baa34..7289d6e 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.03 +Version 0.04 =cut -our $VERSION = '0.03'; +our $VERSION = '0.04'; =head1 SYNOPSIS @@ -98,9 +98,9 @@ The maximum integer used as a signature for user-defined magic. =cut -require XSLoader; +use XSLoader; -XSLoader::load(__PACKAGE__, $VERSION); +XSLoader::load __PACKAGE__, $VERSION; =head2 C @@ -203,7 +203,7 @@ $EXPORT_TAGS{'all'} = \@EXPORT_OK; L (standard since perl 5), L (standard since perl 5.006). -Tests use L (standard since perl 5.002). +Glob tests need L (standard since perl 5.002). =head1 SEE ALSO diff --git a/t/00-load.t b/t/00-load.t index 14ed036..e70be36 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 1; BEGIN { diff --git a/t/01-import.t b/t/01-import.t index 37dc939..cc4aebd 100644 --- a/t/01-import.t +++ b/t/01-import.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 9; require Variable::Magic; diff --git a/t/10-simple.t b/t/10-simple.t index 37d348e..a5d0917 100644 --- a/t/10-simple.t +++ b/t/10-simple.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 14; use Variable::Magic qw/wizard gensig getsig cast dispell/; diff --git a/t/11-multiple.t b/t/11-multiple.t index c77dece..21f37d2 100644 --- a/t/11-multiple.t +++ b/t/11-multiple.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 33; use Variable::Magic qw/wizard cast dispell/; @@ -10,9 +13,9 @@ my @c = (0) x $n; sub multi { my ($cb, $tests) = @_; - for (local $i = 0; $i < $n; ++$i) { - my $res = eval { $cb->() }; - $tests->($res, $@); + for (my $i = 0; $i < $n; ++$i) { + my $res = eval { $cb->($i) }; + $tests->($i, $res, $@); } } @@ -24,9 +27,10 @@ eval { $w[2] = wizard get => sub { ++$c[2] }, set => sub { --$c[2] } }; ok(!$@, "wizard 2 creation error ($@)"); multi sub { + my ($i) = @_; $w[$i] }, sub { - my ($res, $err) = @_; + my ($i, $res, $err) = @_; ok(defined $res, "wizard $i is defined"); ok(ref($w[$i]) eq 'SCALAR', "wizard $i is a scalar ref"); }; @@ -34,9 +38,10 @@ multi sub { my $a = 0; multi sub { + my ($i) = @_; cast $a, $w[$i]; }, sub { - my ($res, $err) = @_; + my ($i, $res, $err) = @_; ok(!$err, "cast magic $i croaks ($err)"); ok($res, "cast magic $i invalid"); }; diff --git a/t/12-data.t b/t/12-data.t index 7e640b3..1e8b9eb 100644 --- a/t/12-data.t +++ b/t/12-data.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 19; use Variable::Magic qw/wizard getdata cast dispell/; diff --git a/t/13-sig.t b/t/13-sig.t index c7b9f49..6564d36 100644 --- a/t/13-sig.t +++ b/t/13-sig.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 24; use Variable::Magic qw/wizard getsig cast dispell SIG_MIN/; diff --git a/t/20-get.t b/t/20-get.t index 215b5df..b79edc8 100644 --- a/t/20-get.t +++ b/t/20-get.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 6; use Variable::Magic qw/wizard cast/; diff --git a/t/21-set.t b/t/21-set.t index 5915142..f731c0d 100644 --- a/t/21-set.t +++ b/t/21-set.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 8; use Variable::Magic qw/wizard cast/; diff --git a/t/22-len.t b/t/22-len.t index 282fd37..c3a9566 100644 --- a/t/22-len.t +++ b/t/22-len.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 6; use Variable::Magic qw/wizard cast/; diff --git a/t/23-clear.t b/t/23-clear.t index 7836d3a..35a49dd 100644 --- a/t/23-clear.t +++ b/t/23-clear.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 7; use Variable::Magic qw/wizard cast/; diff --git a/t/24-free.t b/t/24-free.t index 56fd693..5a90198 100644 --- a/t/24-free.t +++ b/t/24-free.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 4; use Variable::Magic qw/wizard cast/; diff --git a/t/30-scalar.t b/t/30-scalar.t index 3733ab7..ccfba3a 100644 --- a/t/30-scalar.t +++ b/t/30-scalar.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 13; use Variable::Magic qw/wizard cast dispell/; diff --git a/t/31-array.t b/t/31-array.t index 62f4145..bb2f96e 100644 --- a/t/31-array.t +++ b/t/31-array.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 21; use Variable::Magic qw/wizard cast dispell/; diff --git a/t/32-hash.t b/t/32-hash.t index 44510dc..483d967 100644 --- a/t/32-hash.t +++ b/t/32-hash.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 17; use Variable::Magic qw/wizard cast dispell/; diff --git a/t/33-code.t b/t/33-code.t index 538beb2..21d900f 100644 --- a/t/33-code.t +++ b/t/33-code.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More tests => 10; use Variable::Magic qw/wizard cast dispell/; diff --git a/t/34-glob.t b/t/34-glob.t index a1ece33..76e0224 100644 --- a/t/34-glob.t +++ b/t/34-glob.t @@ -1,5 +1,8 @@ #!perl -T +use strict; +use warnings; + use Test::More; eval "use Symbol qw/gensym/"; diff --git a/t/boilerplate.t b/t/boilerplate.t index e0a8da2..a421e46 100644 --- a/t/boilerplate.t +++ b/t/boilerplate.t @@ -2,6 +2,7 @@ use strict; use warnings; + use Test::More tests => 3; sub not_in_file_ok { diff --git a/t/kwalitee.t b/t/kwalitee.t index 1e95c3d..7775e60 100644 --- a/t/kwalitee.t +++ b/t/kwalitee.t @@ -1,5 +1,8 @@ #!perl +use strict; +use warnings; + use Test::More; eval { require Test::Kwalitee; Test::Kwalitee->import() }; diff --git a/t/pod-coverage.t b/t/pod-coverage.t index c9b2024..d0b482d 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -1,6 +1,10 @@ #!perl -T +use strict; +use warnings; + use Test::More; + eval "use Test::Pod::Coverage 1.04"; plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@; all_pod_coverage_ok( { also_private => [ qr/^_/ ] } ); diff --git a/t/pod.t b/t/pod.t index 976d7cd..f1e1d3e 100644 --- a/t/pod.t +++ b/t/pod.t @@ -1,6 +1,10 @@ #!perl -T +use strict; +use warnings; + use Test::More; + eval "use Test::Pod 1.14"; plan skip_all => "Test::Pod 1.14 required for testing POD" if $@; all_pod_files_ok();