This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
B::Deparse: loopexes have assignment prec
[perl5.git] / dist / B-Deparse / t / core.t
index 4128f82..de8d280 100644 (file)
@@ -10,6 +10,8 @@ BEGIN {
 
 use strict;
 use Test::More;
+use feature (sprintf(":%vd", $^V)); # to avoid relying on the feature
+                                    # logic to add CORE::
 
 # Many functions appear in multiple lists, so that shift() and shift(foo)
 # are both tested.
@@ -17,18 +19,19 @@ use Test::More;
 my @nary = (
  # nullary functions
      [qw( abs alarm break chr cos chop close chdir chomp chmod chown
-          chroot caller continue die do dump exp exit exec endgrent
-          endpwent endnetent endhostent endservent endprotoent fork glob
+          chroot caller continue die dump exp exit exec endgrent
+          endpwent endnetent endhostent endservent
+          endprotoent evalbytes fc fork glob
           getppid getpwent getprotoent gethostent getnetent getservent
           getgrent getlogin getc gmtime hex int lc log lstat length
           lcfirst localtime mkdir ord oct pop quotemeta ref rand
           rmdir reset reverse readlink select setpwent setgrent
-          shift sin sleep sqrt srand stat system tell time times
+          shift sin sleep sqrt srand stat __SUB__ system tell time times
           uc utime umask unlink ucfirst wantarray warn wait write    )],
  # unary
      [qw( abs alarm bless binmode chr cos chop close chdir chomp
-          chmod chown chroot closedir die dump exp exit exec
-          each fileno getpgrp getpwnam getpwuid getpeername
+          chmod chown chroot closedir die do dump exp exit exec
+          each evalbytes fc fileno getpgrp getpwnam getpwuid getpeername
           getprotobyname getprotobynumber gethostbyname
           getnetbyname getsockname getgrnam getgrgid
           getc glob gmtime hex int join keys kill lc
@@ -71,7 +74,7 @@ sub CORE_test {
       $deparse->coderef2text(
          eval "no strict 'vars'; sub { () = $expr }" or die "$@in $expr"
       ),
-      qr/\sCORE::$keyword.*;/,
+      qr/\bCORE::$keyword.*[);]/,
       $name||$keyword  
 }