diff options
Diffstat (limited to 'cpan/List-Util/t/reduce.t')
-rw-r--r-- | cpan/List-Util/t/reduce.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cpan/List-Util/t/reduce.t b/cpan/List-Util/t/reduce.t index 2e1257521c..4468ab8611 100644 --- a/cpan/List-Util/t/reduce.t +++ b/cpan/List-Util/t/reduce.t @@ -16,7 +16,7 @@ BEGIN { use List::Util qw(reduce min); use Test::More; -plan tests => 27 + ($::PERL_ONLY ? 0 : 2); +plan tests => 29 + ($::PERL_ONLY ? 0 : 2); my $v = reduce {}; @@ -151,6 +151,13 @@ if (!$::PERL_ONLY) { SKIP: { } } +# XSUB callback +use constant XSUBC => 42; + +is reduce(\&XSUBC, 1, 2, 3), 42, "xsub callbacks"; + +eval { &reduce(1) }; +ok($@ =~ /^Not a subroutine reference/, 'check for code reference'); eval { &reduce(1,2) }; ok($@ =~ /^Not a subroutine reference/, 'check for code reference'); eval { &reduce(qw(a b)) }; |