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.
--- #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
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',
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/;
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.
=head1 VERSION
-Version 0.03
+Version 0.04
=cut
-our $VERSION = '0.03';
+our $VERSION = '0.04';
=head1 SYNOPSIS
=cut
-require XSLoader;
+use XSLoader;
-XSLoader::load(__PACKAGE__, $VERSION);
+XSLoader::load __PACKAGE__, $VERSION;
=head2 C<wizard>
L<Carp> (standard since perl 5), L<XSLoader> (standard since perl 5.006).
-Tests use L<Symbol> (standard since perl 5.002).
+Glob tests need L<Symbol> (standard since perl 5.002).
=head1 SEE ALSO
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 1;
BEGIN {
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 9;
require Variable::Magic;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 14;
use Variable::Magic qw/wizard gensig getsig cast dispell/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 33;
use Variable::Magic qw/wizard cast dispell/;
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, $@);
}
}
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");
};
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");
};
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 19;
use Variable::Magic qw/wizard getdata cast dispell/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 24;
use Variable::Magic qw/wizard getsig cast dispell SIG_MIN/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 6;
use Variable::Magic qw/wizard cast/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 8;
use Variable::Magic qw/wizard cast/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 6;
use Variable::Magic qw/wizard cast/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 7;
use Variable::Magic qw/wizard cast/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 4;
use Variable::Magic qw/wizard cast/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 13;
use Variable::Magic qw/wizard cast dispell/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 21;
use Variable::Magic qw/wizard cast dispell/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 17;
use Variable::Magic qw/wizard cast dispell/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More tests => 10;
use Variable::Magic qw/wizard cast dispell/;
#!perl -T
+use strict;
+use warnings;
+
use Test::More;
eval "use Symbol qw/gensym/";
use strict;
use warnings;
+
use Test::More tests => 3;
sub not_in_file_ok {
#!perl
+use strict;
+use warnings;
+
use Test::More;
eval { require Test::Kwalitee; Test::Kwalitee->import() };
#!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/^_/ ] } );
#!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();