In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/1a6796835b1fd6248863ae596147974216e940b8?hp=9648eab63b366c001d38f6de565f005cf6cea10a>

- Log -----------------------------------------------------------------
commit 1a6796835b1fd6248863ae596147974216e940b8
Author: Father Chrysostomos <[email protected]>
Date:   Mon Jul 25 22:30:17 2016 -0700

    decl-refs.t: I also forgot foreach

M       t/op/decl-refs.t

commit 372d536d6e6fa061deee117a6844852250d17ed9
Author: Father Chrysostomos <[email protected]>
Date:   Mon Jul 25 22:15:24 2016 -0700

    decl-refs.t: I forgot to test \@ and \%

M       t/op/decl-refs.t

commit d4fbd0cac03af55f4d3c2d346bf489c25d4889f5
Author: Karen Etheridge <[email protected]>
Date:   Mon Jul 25 11:57:06 2016 -0700

    upgrade Module-Metadata to 1.000033

M       Porting/Maintainers.pl
M       cpan/Module-Metadata/lib/Module/Metadata.pm
M       cpan/Module-Metadata/t/contains_pod.t
M       cpan/Module-Metadata/t/extract-package.t
M       cpan/Module-Metadata/t/extract-version.t
-----------------------------------------------------------------------

Summary of changes:
 Porting/Maintainers.pl                      |  5 +-
 cpan/Module-Metadata/lib/Module/Metadata.pm | 24 ++++---
 cpan/Module-Metadata/t/contains_pod.t       |  2 +-
 cpan/Module-Metadata/t/extract-package.t    |  2 +-
 cpan/Module-Metadata/t/extract-version.t    |  6 +-
 t/op/decl-refs.t                            | 98 ++++++++++++++++++-----------
 6 files changed, 82 insertions(+), 55 deletions(-)

diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index b617a1a..fba6310 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -814,7 +814,7 @@ use File::Glob qw(:case);
     },
 
     'Module::Metadata' => {
-        'DISTRIBUTION' => 'ETHER/Module-Metadata-1.000032-TRIAL.tar.gz',
+        'DISTRIBUTION' => 'ETHER/Module-Metadata-1.000033.tar.gz',
         'FILES'        => q[cpan/Module-Metadata],
         'EXCLUDED'     => [
             qw(t/00-report-prereqs.t),
@@ -822,9 +822,6 @@ use File::Glob qw(:case);
             qr{weaver.ini},
             qr{^xt},
         ],
-        # https://rt.perl.org/Ticket/Display.html?id=128160
-       # 
https://github.com/Perl-Toolchain-Gang/Module-Metadata/commit/59b3f5b45ff862a1a422a409518255736fe81b66
-        'CUSTOMIZED'   => [ qw[ t/extract-package.t t/metadata.t ] ],
     },
 
     'Net::Ping' => {
diff --git a/cpan/Module-Metadata/lib/Module/Metadata.pm 
b/cpan/Module-Metadata/lib/Module/Metadata.pm
index e8c2b25..7f49da6 100644
--- a/cpan/Module-Metadata/lib/Module/Metadata.pm
+++ b/cpan/Module-Metadata/lib/Module/Metadata.pm
@@ -1,6 +1,6 @@
 # -*- mode: cperl; tab-width: 8; indent-tabs-mode: nil; basic-offset: 2 -*-
 # vim:ts=8:sw=2:et:sta:sts=2:tw=78
-package Module::Metadata; # git description: v1.000031-13-g7c061c9
+package Module::Metadata; # git description: v1.000032-7-gb4e8a3f
 # ABSTRACT: Gather package and POD information from perl module files
 
 # Adapted from Perl-licensed code originally distributed with
@@ -14,7 +14,7 @@ sub __clean_eval { eval $_[0] }
 use strict;
 use warnings;
 
-our $VERSION = '1.000032'; # TRIAL
+our $VERSION = '1.000033';
 
 use Carp qw/croak/;
 use File::Spec;
@@ -841,7 +841,7 @@ Module::Metadata - Gather package and POD information from 
perl module files
 
 =head1 VERSION
 
-version 1.000032
+version 1.000033
 
 =head1 SYNOPSIS
 
@@ -1070,7 +1070,7 @@ assistance from David Golden (xdg) <[email protected]>.
 
 =head1 CONTRIBUTORS
 
-=for stopwords Karen Etheridge David Golden Vincent Pit Matt S Trout Chris 
Nehren Graham Knop Olivier Mengué Tomas Doran Tatsuhiko Miyagawa tokuhirom 
Peter Rabbitson Steve Hay Josh Jore Craig A. Ber ... [116 chars truncated]
+=for stopwords Karen Etheridge David Golden Vincent Pit Matt S Trout Chris 
Nehren Graham Knop Olivier Mengué Tomas Doran Tatsuhiko Miyagawa tokuhirom 
Kent Fredric Peter Rabbitson Steve Hay Jerry D.  ... [116 chars truncated]
 
 =over 4
 
@@ -1116,6 +1116,10 @@ tokuhirom <[email protected]>
 
 =item *
 
+Kent Fredric <[email protected]>
+
+=item *
+
 Peter Rabbitson <[email protected]>
 
 =item *
@@ -1124,7 +1128,7 @@ Steve Hay <[email protected]>
 
 =item *
 
-Josh Jore <[email protected]>
+Jerry D. Hedden <[email protected]>
 
 =item *
 
@@ -1132,6 +1136,10 @@ Craig A. Berry <[email protected]>
 
 =item *
 
+Craig A. Berry <[email protected]>
+
+=item *
+
 David Mitchell <[email protected]>
 
 =item *
@@ -1152,15 +1160,11 @@ James Raspass <[email protected]>
 
 =item *
 
-Jerry D. Hedden <[email protected]>
-
-=item *
-
 Chris 'BinGOs' Williams <[email protected]>
 
 =item *
 
-Kent Fredric <[email protected]>
+Josh Jore <[email protected]>
 
 =back
 
diff --git a/cpan/Module-Metadata/t/contains_pod.t 
b/cpan/Module-Metadata/t/contains_pod.t
index 016e784..d2b7c50 100644
--- a/cpan/Module-Metadata/t/contains_pod.t
+++ b/cpan/Module-Metadata/t/contains_pod.t
@@ -4,7 +4,7 @@ use Test::More tests => 3;
 use Module::Metadata;
 
 BEGIN {
-  *fh_from_string = $] < 5.008
+  *fh_from_string = "$]" < 5.008
     ? require IO::Scalar && sub ($) {
       IO::Scalar->new(\$_[0]);
     }
diff --git a/cpan/Module-Metadata/t/extract-package.t 
b/cpan/Module-Metadata/t/extract-package.t
index b1b776c..44f4de9 100644
--- a/cpan/Module-Metadata/t/extract-package.t
+++ b/cpan/Module-Metadata/t/extract-package.t
@@ -142,7 +142,7 @@ foreach my $test_case (@pkg_names) {
     my $warnings = '';
     local $SIG{__WARN__} = sub { $warnings .= $_ for @_ };
 
-    my $pm_info = 
Module::Metadata->new_from_file(generate_file(File::Spec->catdir($tmpdir, 
"Simple${test_num}"), 'Simple.pm', $code));
+    my $pm_info = 
Module::Metadata->new_from_file(generate_file(File::Spec->catfile($tmpdir, 
"Simple${test_num}"), 'Simple.pm', $code));
 
     # whenever we drop support for 5.6, we can do this:
     # open my $fh, '<', \(encode('UTF-8', $code, Encode::FB_CROAK))
diff --git a/cpan/Module-Metadata/t/extract-version.t 
b/cpan/Module-Metadata/t/extract-version.t
index 16266e8..1a49be1 100644
--- a/cpan/Module-Metadata/t/extract-version.t
+++ b/cpan/Module-Metadata/t/extract-version.t
@@ -626,14 +626,14 @@ foreach my $test_case (@modules) {
 
   SKIP: {
     skip( "No our() support until perl 5.6", (defined $expected_version ? 3 : 
2) )
-        if $] < 5.006 && $code =~ /\bour\b/;
+        if "$]" < 5.006 && $code =~ /\bour\b/;
     skip( "No package NAME VERSION support until perl 5.11.1", (defined 
$expected_version ? 3 : 2) )
-        if $] < 5.011001 && $code =~ /package\s+[\w\:\']+\s+v?[0-9._]+/;
+        if "$]" < 5.011001 && $code =~ /package\s+[\w\:\']+\s+v?[0-9._]+/;
 
     my $warnings = '';
     local $SIG{__WARN__} = sub { $warnings .= $_ for @_ };
 
-    my $pm_info = 
Module::Metadata->new_from_file(generate_file(File::Spec->catdir($tmpdir, 
"Simple${test_num}"), 'Simple.pm', $code));
+    my $pm_info = 
Module::Metadata->new_from_file(generate_file(File::Spec->catfile($tmpdir, 
"Simple${test_num}"), 'Simple.pm', $code));
 
     # whenever we drop support for 5.6, we can do this:
     # open my $fh, '<', \(encode('UTF-8', $code, Encode::FB_CROAK))
diff --git a/t/op/decl-refs.t b/t/op/decl-refs.t
index 2c11daa..80e6b7f 100644
--- a/t/op/decl-refs.t
+++ b/t/op/decl-refs.t
@@ -4,15 +4,18 @@ BEGIN {
     set_up_inc('../lib');
 }
 
-plan 188;
+plan 402;
 
 for my $decl (qw< my CORE::state our local >) {
     for my $funny (qw< $ @ % >) {
         # Test three syntaxes with each declarator/funny char combination:
-        #     my \$foo    my(\$foo)    my\($foo)
+        #     my \$foo    my(\$foo)    my\($foo)    for my \$foo
 
         for my $code("$decl \\${funny}x", "$decl\(\\${funny}x\)",
-                     "$decl\\\(${funny}x\)") {
+                     "$decl\\\(${funny}x\)",
+                     "for $decl \\${funny}x (\\${funny}y) {}") {
+          SKIP: {
+            skip "for local is illegal", 3 if $code =~ /^for local/;
             eval $code;
             like
                 $@,
@@ -27,6 +30,7 @@ for my $decl (qw< my CORE::state our local >) {
             is $c, 1, "one warning from $code";
             like $w, qr/^Declaring references is experimental at /,
                 "experimental warning for $code";
+          }
         }
     }
 }
@@ -35,62 +39,84 @@ use feature 'declared_refs', 'state';
 no warnings 'experimental::declared_refs';
 
 for $decl ('my', 'state', 'our', 'local') {
+for $sigl ('$', '@', '%') {
+    # The weird code that follows uses ~ as a sigil placeholder and MY
+    # as a declarator placeholder.
     my $code = '#line ' . (__LINE__+1) . ' ' . __FILE__ . "\n" . <<'END';
-    my $ret = MY \$a;
-    is $ret, \$a, 'MY \$a returns ref to $a';
-    isnt $ret, \$::a, 'MY \$a ret val is not pkg var';
-    my @ret = MY \($b, $c);
-    is "@ret", \$b." ".\$c, 'MY \($b, $c) returns correct refs';
-    isnt $ret[0], \$::b, 'first retval of MY \($b, $c) is not pkg var';
-    isnt $ret[1], \$::c, '2nd retval of MY \($b, $c) is not pkg var';
-    @ret = MY (\($d, $e));
-    is "@ret", \$d." ".\$e, 'MY (\($d, $e)) returns correct refs';
-    isnt $ret[0], \$::d, 'first retval of MY (\($d, $e)) is not pkg var';
-    isnt $ret[1], \$::e, '2nd retval of MY (\($d, $e)) is not pkg var';
-    @ret = \MY (\$f, $g);
-    is ${$ret[0]}, \$f, 'first retval of MY (\$f, $g) is \$f';
-    isnt ${$ret[0]}, \$::f, 'first retval of MY (\$f, $g) is not \$::f';
-    is $ret[1], \$g, '2nd retval of MY (\$f, $g) is $g';
-    isnt $ret[1], \$::g, '2nd retval of MY (\$f, $g) is not $::g';
+    my $ret = MY \~a;
+    is $ret, \~a, 'MY \$a returns ref to $a';
+    isnt $ret, \~::a, 'MY \$a ret val is not pkg var';
+    my @ret = MY \(~b, ~c);
+    is "@ret", \~b." ".\~c, 'MY \(~b, ~c) returns correct refs';
+    isnt $ret[0], \~::b, 'first retval of MY \(~b, ~c) is not pkg var';
+    isnt $ret[1], \~::c, '2nd retval of MY \(~b, ~c) is not pkg var';
+    @ret = MY (\(~d, ~e));
+    is "@ret", \~d." ".\~e, 'MY (\(~d, ~e)) returns correct refs';
+    isnt $ret[0], \~::d, 'first retval of MY (\(~d, ~e)) is not pkg var';
+    isnt $ret[1], \~::e, '2nd retval of MY (\(~d, ~e)) is not pkg var';
+    @ret = \MY (\~f, ~g);
+    is ${$ret[0]}, \~f, 'first retval of MY (\~f, ~g) is \~f';
+    isnt ${$ret[0]}, \~::f, 'first retval of MY (\~f, ~g) is not \~::f';
+    is $ret[1], \~g, '2nd retval of MY (\~f, ~g) is ~g';
+    isnt $ret[1], \~::g, '2nd retval of MY (\~f, ~g) is not ~::g';
     *MODIFY_SCALAR_ATTRIBUTES = sub {
-        is @_, 3, 'MY \$h : risible  calls handler with right no. of args';
-        is $_[2], 'risible', 'correct attr passed by MY \$h : risible';
+        is @_, 3, 'MY \~h : risible  calls handler with right no. of args';
+        is $_[2], 'risible', 'correct attr passed by MY \~h : risible';
         return;
     };
     SKIP : {
         unless ('MY' eq 'local') {
             skip_if_miniperl "No attributes on miniperl", 2;
-            eval 'MY \$h : risible' or die $@ unless 'MY' eq 'local';
+            eval 'MY \~h : risible' or die $@ unless 'MY' eq 'local';
         }
     }
-    eval 'MY \$a ** 1';
+    eval 'MY \~a ** 1';
     like $@,
         qr/^Can't (?:declare|modify) exponentiation \(\*\*\) in "?MY"? at/,
-       'comp error for MY \$a ** 1';
-    $ret = MY \\$i;
-    is $$ret, \$i, 'retval of MY \\$i is ref to ref to $i';
-    $ret = MY \\$i;
-    isnt $$ret, \$::i, 'retval of MY \\$i is ref to ref to $::i';
-    $ret = MY (\\$i);
-    is $$ret, \$i, 'retval of MY (\\$i) is ref to ref to $i';
-    $ret = MY (\\$i);
-    isnt $$ret, \$::i, 'retval of MY (\\$i) is ref to ref to $::i';
+       'comp error for MY \~a ** 1';
+    $ret = MY \\~i;
+    is $$ret, \~i, 'retval of MY \\~i is ref to ref to ~i';
+    $ret = MY \\~i;
+    isnt $$ret, \~::i, 'retval of MY \\~i is ref to ref to ~::i';
+    $ret = MY (\\~i);
+    is $$ret, \~i, 'retval of MY (\\~i) is ref to ref to ~i';
+    $ret = MY (\\~i);
+    isnt $$ret, \~::i, 'retval of MY (\\~i) is ref to ref to ~::i';
     *MODIFY_SCALAR_ATTRIBUTES = sub {
-        is @_, 3, 'MY (\$h) : bumpy  calls handler with right no. of args';
-        is $_[2], 'bumpy', 'correct attr passed by MY (\$h) : bumpy';
+        is @_, 3, 'MY (\~h) : bumpy  calls handler with right no. of args';
+        is $_[2], 'bumpy', 'correct attr passed by MY (\~h) : bumpy';
         return;
     };
     SKIP : {
         unless ('MY' eq 'local') {
             skip_if_miniperl "No attributes on miniperl", 2;
-            eval 'MY (\$h) : bumpy' or die $@;
+            eval 'MY (\~h) : bumpy' or die $@;
         }
     }
     1;
 END
     $code =~ s/MY/$decl/g;
+    $code =~ s/~/$sigl/g;
+    $code =~ s/MODIFY_\KSCALAR/$sigl eq '@' ? "ARRAY" : "HASH"/eggnog
+        if $sigl ne '$';
     if ($decl =~ /^(?:our|local)\z/) {
         $code =~ s/is ?no?t/is/g; # tests for package vars
     }
     eval $code or die $@;
-}
+}}
+
+use feature 'refaliasing'; no warnings "experimental::refaliasing";
+for $decl ('my', 'state', 'our') {
+for $sigl ('$', '@', '%') {
+    my $code = '#line ' . (__LINE__+1) . ' ' . __FILE__ . "\n" . <<'ENE';
+    for MY \~x (\~::y) {
+        is \~x, \~::y, '\~x aliased by for MY \~x';
+        isnt \~x, \~::x, '\~x is not equivalent to \~::x';
+    }
+    1;
+ENE
+    $code =~ s/MY/$decl/g;
+    $code =~ s/~/$sigl/g;
+    $code =~ s/is ?no?t/is/g if $decl eq 'our';
+    eval $code or die $@;
+}}

--
Perl5 Master Repository

Reply via email to