Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test reduce aliasing arguments #66

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion t/reduce.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;

use List::Util qw(reduce min);
use Test::More;
plan tests => 30 + ($::PERL_ONLY ? 0 : 2);
plan tests => 31 + ($::PERL_ONLY ? 0 : 2);

my $v = reduce {};

Expand Down Expand Up @@ -163,3 +163,10 @@ ok($@ =~ /^Not a subroutine reference/, 'check for code reference');
my @names = ("a\x{100}c", "d\x{101}efgh", 'ijk');
my $longest = reduce { length($a) > length($b) ? $a : $b } @names;
is( length($longest), 6, 'missing SMG rt#121992');

{
my @array = (1..5);
my $result = reduce { $a += 1; $b += 1; $a + $b } @array;
is_deeply \@array, [1, 3..6],
'$b is aliased in reduce';
}