r58046 - in /branches/upstream/libvariable-magic-perl/current: Changes META.yml README lib/Variable/Magic.pm t/18-opinfo.t t/22-len.t t/30-scalar.t
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Wed May 19 09:34:57 UTC 2010
Author: angelabad-guest
Date: Wed May 19 09:34:35 2010
New Revision: 58046
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=58046
Log:
[svn-upgrade] Integrating new upstream version, libvariable-magic-perl (0.42)
Modified:
branches/upstream/libvariable-magic-perl/current/Changes
branches/upstream/libvariable-magic-perl/current/META.yml
branches/upstream/libvariable-magic-perl/current/README
branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm
branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t
branches/upstream/libvariable-magic-perl/current/t/22-len.t
branches/upstream/libvariable-magic-perl/current/t/30-scalar.t
Modified: branches/upstream/libvariable-magic-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/Changes?rev=58046&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/Changes (original)
+++ branches/upstream/libvariable-magic-perl/current/Changes Wed May 19 09:34:35 2010
@@ -1,4 +1,10 @@
Revision history for Variable-Magic
+
+0.42 2010-05-19 00:15 UTC
+ This is a maintenance release. The code contains no functional change.
+ Users of 0.41 can skip this update.
+ + Fix : Test failures with perl 5.13.
+ + Tst : Improve coverage.
0.41 2010-03-15 17:35 UTC
+ Doc : Tweaks and fixups.
Modified: branches/upstream/libvariable-magic-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/META.yml?rev=58046&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/META.yml (original)
+++ branches/upstream/libvariable-magic-perl/current/META.yml Wed May 19 09:34:35 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Variable-Magic
-version: 0.41
+version: 0.42
abstract: Associate user-defined magic to variables from Perl.
author:
- Vincent Pit <perl at profvince.com>
Modified: branches/upstream/libvariable-magic-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/README?rev=58046&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/README (original)
+++ branches/upstream/libvariable-magic-perl/current/README Wed May 19 09:34:35 2010
@@ -2,7 +2,7 @@
Variable::Magic - Associate user-defined magic to variables from Perl.
VERSION
- Version 0.41
+ Version 0.42
SYNOPSIS
use Variable::Magic qw/wizard cast VMG_OP_INFO_NAME/;
Modified: branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm?rev=58046&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm (original)
+++ branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm Wed May 19 09:34:35 2010
@@ -13,13 +13,13 @@
=head1 VERSION
-Version 0.41
+Version 0.42
=cut
our $VERSION;
BEGIN {
- $VERSION = '0.41';
+ $VERSION = '0.42';
}
=head1 SYNOPSIS
Modified: branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t?rev=58046&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t (original)
+++ branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t Wed May 19 09:34:35 2010
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 14 * (3 + 4) + 5;
+use Test::More tests => 17 * (3 + 4) + 5;
use Config qw/%Config/;
@@ -11,19 +11,29 @@
sub Variable::Magic::TestPkg::foo { }
-my $aelem = $] <= 5.008003 ? 'aelem' : 'aelemfast';
-my $aelem_op = $Config{useithreads} ? 'B::PADOP' : 'B::SVOP';
+my $is_5130_release = ($] == 5.013 && !$Config{git_describe}) ? 1 : 0;
+
+my $aelem = $] <= 5.008003 ? 'aelem'
+ : ($] < 5.013 or $is_5130_release) ? 'aelemfast'
+ : 'sassign';
+my $aelemf = ($] < 5.013 or $is_5130_release) ? 'aelemfast' : 'sassign';
+my $aelemf_op = $aelemf eq 'sassign'
+ ? 'B::BINOP' : $Config{useithreads} ? 'B::PADOP' : 'B::SVOP';
our @o;
my @tests = (
[ 'len', '@c', 'my @c', 'my $x = @c', [ 'padav', 'B::OP' ] ],
[ 'get', '$c[0]', 'my @c', 'my $x = $c[0]', [ $aelem, 'B::OP' ] ],
- [ 'get', '$o[0]', 'local @o', 'my $x = $o[0]', [ 'aelemfast', $aelem_op ] ],
+ [ 'get', '$o[0]', 'local @o', 'my $x = $o[0]', [ $aelemf, $aelemf_op ] ],
[ 'get', '$c', 'my $c = 1', '++$c', [ 'preinc', 'B::UNOP' ] ],
[ 'get', '$c', 'my $c = 1', '$c ** 2', [ 'pow', 'B::BINOP' ] ],
[ 'get', '$c', 'my $c = 1', 'my $x = $c', [ 'sassign', 'B::BINOP' ] ],
[ 'get', '$c', 'my $c = 1', '1 if $c', [ 'and', 'B::LOGOP' ] ],
+ [ 'get', '$c', 'my $c = []','ref $c', [ 'ref', 'B::UNOP' ] ],
+ [ 'get', '$c', 'my $c = $0','-f $c', [ 'ftfile', 'B::UNOP' ] ],
+ [ 'get', '$c', 'my $c = "Z"',
+ 'my $i = 1; Z:goto $c if $i--', [ 'goto', 'B::UNOP' ] ],
[ 'set', '$c', 'my $c = 1', 'bless \$c, "main"',
[ 'bless', 'B::LISTOP' ] ],
[ 'get', '$c', 'my $c = ""','$c =~ /x/', [ 'match', 'B::PMOP' ] ],
Modified: branches/upstream/libvariable-magic-perl/current/t/22-len.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/t/22-len.t?rev=58046&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/t/22-len.t (original)
+++ branches/upstream/libvariable-magic-perl/current/t/22-len.t Wed May 19 09:34:35 2010
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 33 + (2 * 2 + 1);
+use Test::More tests => 39 + (2 * 2 + 1);
use Variable::Magic qw/wizard cast dispell VMG_COMPAT_SCALAR_LENGTH_NOLEN/;
@@ -129,6 +129,35 @@
}
{
+ our $c;
+ # length magic on scalars needs also get magic to be triggered.
+ my $wiz = wizard get => sub { 0 },
+ len => sub { $d = $_[2]; ++$c; return $_[2] };
+
+ {
+ my $x = "banana";
+ cast $x, $wiz;
+
+ local $c = 0;
+ pos($x) = 2;
+ is $c, 1, 'len: pos scalar triggers magic correctly';
+ is $d, 6, 'len: pos scalar have correct default length';
+ is $x, 'banana', 'len: pos scalar works correctly'
+ }
+
+ {
+ my $x = "hl\x{20AB}gh"; # Force utf8 on string
+ cast $x, $wiz;
+
+ local $c = 0;
+ substr($x, 2, 1) = 'a';
+ is $c, 1, 'len: substr utf8 scalar triggers magic correctly';
+ is $d, 5, 'len: substr utf8 scalar have correct default length';
+ is $x, 'hlagh', 'len: substr utf8 scalar correctly';
+ }
+}
+
+{
my @val = (4 .. 6);
my $wv = init_value @val, 'len', 'len';
Modified: branches/upstream/libvariable-magic-perl/current/t/30-scalar.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/t/30-scalar.t?rev=58046&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/t/30-scalar.t (original)
+++ branches/upstream/libvariable-magic-perl/current/t/30-scalar.t Wed May 19 09:34:35 2010
@@ -11,6 +11,8 @@
use lib 't/lib';
use Variable::Magic::TestWatcher;
+
+my $is_5130_release = ($] == 5.013 && !$Config{git_describe}) ? 1 : 0;
my $wiz = init_watcher
[ qw/get set len clear free copy dup local fetch store exists delete/ ],
@@ -58,7 +60,7 @@
watch { $a[1] = 6; () } { set => 1 }, 'array element: set';
-$b = watch { $a[1] } { get => 1 }, 'array element: get';
+$b = watch { $a[1] } { get => ($is_5130_release ? 2 : 1) },'array element: get';
is $b, 6, 'scalar: array element: get correctly';
watch { $a[0] = 5 } { }, 'array element: set other';
@@ -83,7 +85,7 @@
watch { $h{b} = 6; () } { set => 1 }, 'hash element: set';
-$b = watch { $h{b} } { get => 1 }, 'hash element: get';
+$b = watch { $h{b} } { get => ($is_5130_release ? 2 : 1) }, 'hash element: get';
is $b, 6, 'scalar: hash element: get correctly';
watch { $h{a} = 5 } { }, 'hash element: set other';
More information about the Pkg-perl-cvs-commits
mailing list