This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
rename aggref warnings to autoderef
[perl5.git] / lib / B / Deparse-core.t
index eaa2689..8d4c3a1 100644 (file)
@@ -36,10 +36,11 @@ BEGIN {
 
 use strict;
 use Test::More;
-plan tests => 2063;
+plan tests => 2071;
 
 use feature (sprintf(":%vd", $^V)); # to avoid relying on the feature
                                     # logic to add CORE::
+no warnings 'experimental::autoderef';
 use B::Deparse;
 my $deparse = new B::Deparse;
 
@@ -62,8 +63,6 @@ sub testit {
     for my $lex (0, 1, 2) {
        if ($lex) {
            next if $keyword =~ /local|our|state|my/;
-           # XXX glob(my $x) incorrectly becomes <my $x>
-           next if $keyword eq 'glob';
        }
        my $vars = $lex == 1 ? 'my($a, $b, $c, $d, $e);' . "\n    " : "";
 
@@ -94,6 +93,7 @@ sub testit {
 
        unless ($got_text =~ /^{
     package test;
+    BEGIN {\${\^WARNING_BITS} = "[^"]*"}
     use strict 'refs', 'subs';
     use feature [^\n]+
     \Q$vars\E\(\) = (.*)
@@ -225,13 +225,10 @@ testit exists   => 'exists $h{\'foo\'};',       'exists $h{\'foo\'};';
 
 testit exec     => 'CORE::exec($foo $bar);';
 
-# glob($x) gets deparsed as glob("$x").
-# Whether this is correct, I don't know; but I didn't want
-# to start messing with the whole glob/readline/<> mess - DAPM.
-testit glob     => 'glob;',                       'glob("$_");';
-testit glob     => 'CORE::glob;',                 'glob("$_");';
-testit glob     => 'glob $a;',                    'glob("$a");';
-testit glob     => 'CORE::glob $a;',              'glob("$a");';
+testit glob     => 'glob;',                       'glob($_);';
+testit glob     => 'CORE::glob;',                 'CORE::glob($_);';
+testit glob     => 'glob $a;',                    'glob($a);';
+testit glob     => 'CORE::glob $a;',              'CORE::glob($a);';
 
 testit grep     => 'CORE::grep { $a } $b, $c',    'grep({$a;} $b, $c);';