This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Deparse typed vars
[perl5.git] / lib / B / Deparse.t
index fd727c2..81f0f37 100644 (file)
@@ -281,6 +281,13 @@ is($deparse->coderef2text(sub{ use utf8; /€/; }),
 done_testing($tests);
 
 __DATA__
+# TODO [perl #120950] This succeeds when run a 2nd time
+# y/uni/code/
+tr/\x{345}/\x{370}/;
+####
+# y/uni/code/  [perl #120950] This 2nd instance succeeds
+tr/\x{345}/\x{370}/;
+####
 # A constant
 1;
 ####
@@ -337,6 +344,24 @@ print $main::x[1];
 my %x;
 $x{warn()};
 ####
+# our (LIST)
+our($foo, $bar, $baz);
+####
+# CONTEXT { package Dog } use feature "state";
+# variables with declared classes
+my Dog $spot;
+our Dog $spotty;
+state Dog $spotted;
+my Dog @spot;
+our Dog @spotty;
+state Dog @spotted;
+my Dog %spot;
+our Dog %spotty;
+state Dog %spotted;
+my Dog ($foo, @bar, %baz);
+our Dog ($phoo, @barr, %bazz);
+state Dog ($fough, @barre, %bazze);
+####
 # <>
 my $foo;
 $_ .= <ARGV> . <$foo>;
@@ -965,13 +990,11 @@ foreach $' (1, 2) {
 # y///r
 tr/a/b/r;
 ####
-# y/uni/code/
-tr/\x{345}/\x{370}/;
-####
 # [perl #90898]
 <a,>;
 ####
 # [perl #91008]
+# CONTEXT no warnings 'experimental::autoderef';
 each $@;
 keys $~;
 values $!;
@@ -1423,3 +1446,25 @@ print f();
 ####
 # Elements of %# should not be confused with $#{ array }
 () = ${#}{'foo'};
+####
+# [perl #121050] Prototypes with whitespace
+sub _121050(\$ \$) { }
+_121050($a,$b);
+sub _121050empty( ) {}
+() = _121050empty() + 1;
+>>>>
+_121050 $a, $b;
+() = _121050empty + 1;
+####
+# ensure aelemfast works in the range -128..127 and that there's no
+# funky edge cases
+my $x;
+no strict 'vars';
+$x = $a[-256] + $a[-255] + $a[-129] + $a[-128] + $a[-127] + $a[-1] + $a[0];
+$x = $a[1] + $a[126] + $a[127] + $a[128] + $a[255] + $a[256];
+my @b;
+$x = $b[-256] + $b[-255] + $b[-129] + $b[-128] + $b[-127] + $b[-1] + $b[0];
+$x = $b[1] + $b[126] + $b[127] + $b[128] + $b[255] + $b[256];
+####
+# 'm' must be preserved in m??
+m??;