summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/first.t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/first.t')
-rw-r--r--gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/first.t17
1 files changed, 7 insertions, 10 deletions
diff --git a/gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/first.t b/gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/first.t
index ba7726ae562..3f008e703c0 100644
--- a/gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/first.t
+++ b/gnu/usr.bin/perl/cpan/Scalar-List-Utils/t/first.t
@@ -5,10 +5,10 @@ use warnings;
use List::Util qw(first);
use Test::More;
-plan tests => 22 + ($::PERL_ONLY ? 0 : 2);
+plan tests => 24;
my $v;
-ok(defined &first, 'defined');
+ok(defined &first, 'defined');
$v = first { 8 == ($_ - 1) } 9,4,5,6;
is($v, 9, 'one more than 8');
@@ -20,7 +20,7 @@ $v = first { 0 };
is($v, undef, 'no args');
$v = first { $_->[1] le "e" and "e" le $_->[2] }
- [qw(a b c)], [qw(d e f)], [qw(g h i)];
+ [qw(a b c)], [qw(d e f)], [qw(g h i)];
is_deeply($v, [qw(d e f)], 'reference args');
# Check that eval{} inside the block works correctly
@@ -89,11 +89,9 @@ SKIP: {
is(&Internals::SvREFCNT(\&huge), $refcnt, "Refcount unchanged");
}
-# The remainder of the tests are only relevant for the XS
-# implementation. The Perl-only implementation behaves differently
-# (and more flexibly) in a way that we can't emulate from XS.
-if (!$::PERL_ONLY) { SKIP: {
-
+# These tests are only relevant for the real multicall implementation. The
+# psuedo-multicall implementation behaves differently.
+SKIP: {
$List::Util::REAL_MULTICALL ||= 0; # Avoid use only once
skip("Poor man's MULTICALL can't cope", 2)
if !$List::Util::REAL_MULTICALL;
@@ -105,8 +103,7 @@ if (!$::PERL_ONLY) { SKIP: {
# Can we goto a subroutine?
eval {()=first{goto sub{}} 1,2;};
like($@, qr/^Can't goto subroutine from a sort sub/, "goto sub");
-
-} }
+}
use constant XSUBC_TRUE => 1;
use constant XSUBC_FALSE => 0;