Acme-Signature-Arity

 view release on metacpan or  search on metacpan

t/00-report-prereqs.t  view on Meta::CPAN

}
else {
    $cpan_meta_error = $@;    # capture error from CPAN::Meta->load_file($source)
    $source = 'static metadata';
}

my @full_reports;
my @dep_errors;
my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;

# Add static includes into a fake section
for my $mod (@include) {
    $req_hash->{other}{modules}{$mod} = 0;
}

for my $phase ( qw(configure build test runtime develop other) ) {
    next unless $req_hash->{$phase};
    next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});

    for my $type ( qw(requires recommends suggests conflicts modules) ) {
        next unless $req_hash->{$phase}{$type};

t/arity.t  view on Meta::CPAN

        my $code = eval $def;
        is(min_arity($code), $args{min}, 'min arity is ' . ($args{min} // '<undef>')) or note explain [ arity($code) ] if exists $args{min};
        is(max_arity($code), $args{max}, 'max arity is ' . ($args{max} // '<undef>')) or note explain [ arity($code) ] if exists $args{max};
        done_testing;
    };
}

is(eval {
    Acme::Signature::Arity::coderef_ignoring_extra(sub ($x) {
        die 'invalid data passed' unless $x eq "first"
    })->("first", "second", 3, 4);
    1
}, 1) or note explain $@;

done_testing;



( run in 0.861 second using v1.01-cache-2.11-cpan-39bf76dae61 )