libxs-parse-sublike-perl/t/05func-sig-attributes.t

31 lines
527 B
Perl
Raw Permalink Normal View History

2024-07-10 16:56:00 +08:00
#!/usr/bin/perl
use v5.14;
use warnings;
use Test2::V0;
BEGIN {
$] >= 5.026000 or plan skip_all => "No parse_subsignature()";
}
use feature 'signatures';
no warnings 'experimental';
use lib "t";
use testcase "t::func";
BEGIN { $^H{"t::func/afunc"}++ }
BEGIN { $^H{"t::func/Attribute"}++ }
our @ATTRIBUTE_APPLIED;
{
afunc withattr($x :Attribute, $y :Attribute(Value)) { }
is( \@ATTRIBUTE_APPLIED,
[ '$x' => undef, '$y' => "Value" ],
':Attribute applied to subroutine parameters' );
}
done_testing;