Skip to content

Commit

Permalink
test return value of signature_for
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyink committed Oct 19, 2024
1 parent d8b2ea1 commit 8c641c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/20-modules/Type-Params/v2-positional.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ BEGIN {
use Types::Standard -types;
use Type::Params -sigs;

signature_for myfunc => (
my $meta = signature_for myfunc => (
method => Object | Str,
pos => [ ArrayRef, Int ],
);

sub get_meta { $meta }

sub myfunc ( $self, $arr, $int ) {
return $arr->[$int];
}
Expand All @@ -61,6 +63,8 @@ BEGIN {
my $o = bless {} => 'Local::MyPackage';
my @arr = ( 'a' .. 'z' );

ok( Local::MyPackage->get_meta->isa('Type::Params::Signature'), 'return value of signature_for' );

is $o->myfunc( \@arr, 2 ), 'c', 'myfunc (happy path)';
is $o->myfunc2( \@arr, 4 ), 'e', 'myfunc2 (happy path)';

Expand Down

0 comments on commit 8c641c2

Please sign in to comment.