File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ BEGIN {
1313use warnings;
1414use strict;
1515
16- my $tests = 53 ; # not counting those in the __DATA__ section
16+ my $tests = 55 ; # not counting those in the __DATA__ section
1717
1818use B::Deparse;
1919my $deparse = B::Deparse-> new();
566566 qr / +method m \(\) \{\n +\$ x\+\+ ;\n +\} / ,
567567 " feature class method deparses as method" ;
568568
569+ # GH#23699
570+ {
571+ my $signatured_sub = do {
572+ use feature qw( signatures ) ;
573+ sub ($x , $y ) { return $x + $y ; }
574+ };
575+
576+ {
577+ use feature qw( signatures ) ;
578+ $deparse -> ambient_pragmas_from_caller;
579+ my $deparsed = $deparse -> coderef2text( $signatured_sub );
580+ like $deparsed , qr / ^\(\$ x, \$ y\) \{ / ,
581+ ' Deparsed signatured sub under use feature qw( signatures )' ;
582+ }
583+
584+ {
585+ use v5.36;
586+ $deparse -> ambient_pragmas_from_caller;
587+ my $deparsed = $deparse -> coderef2text( $signatured_sub );
588+ like $deparsed , qr / ^\(\$ x, \$ y\) \{ / ,
589+ ' Deparsed signatured sub under use v5.36' ;
590+ }
591+ }
569592
570593done_testing($tests );
571594
You can’t perform that action at this time.
0 commit comments