From d3f14711a3e2419f59e93f408e4854366c3997cb Mon Sep 17 00:00:00 2001 From: dakkar Date: Sun, 19 Jun 2016 18:30:22 +0100 Subject: bump perl requirement to 5.24 I can haz postderef! --- t/lib/Test/Sietima.pm | 12 ++++++------ t/lib/Test/Sietima/MailStore.pm | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 't/lib') diff --git a/t/lib/Test/Sietima.pm b/t/lib/Test/Sietima.pm index 549d654..115a1e6 100644 --- a/t/lib/Test/Sietima.pm +++ b/t/lib/Test/Sietima.pm @@ -1,7 +1,7 @@ package Test::Sietima; use strict; use warnings; -use 5.020; +use 5.024; use lib 't/lib'; use Import::Into; use Email::Stuffer; @@ -21,7 +21,7 @@ sub import { for my $function (qw(transport make_sietima make_mail deliveries_are test_sending)) { no strict 'refs'; - *{"${target}::${function}"} = __PACKAGE__->can($function); + "${target}::${function}"->** = __PACKAGE__->can($function); } return; } @@ -38,7 +38,7 @@ sub make_sietima { my $class = 'Sietima'; if (my $traits = delete $args{with_traits}) { - $class = $class->with_traits(@{$traits}); + $class = $class->with_traits($traits->@*); } $class->new({ @@ -57,7 +57,7 @@ my $maybe = sub { my $mapit = sub { my ($obj,$method,$arg) = @_; return $obj unless $arg; - for my $k (keys %{$arg}) { + for my $k (keys $arg->%*) { $obj = $obj->$method($k, $arg->{$k}); } return $obj; @@ -81,7 +81,7 @@ sub deliveries_are { my $ctx = context(); my $to = $args{to}; - my @recipients = ref($to) ? @{$to} : $to; + my @recipients = ref($to) ? $to->@* : $to; my @deliveries = transport->deliveries; is( \@deliveries, @@ -131,7 +131,7 @@ sub test_sending { ); $args{from} ||= $sietima->return_path; - $args{to} ||= [ map { $_->address} @{$sietima->subscribers} ]; + $args{to} ||= [ map { $_->address} $sietima->subscribers->@* ]; deliveries_are(%args); $ctx->release; diff --git a/t/lib/Test/Sietima/MailStore.pm b/t/lib/Test/Sietima/MailStore.pm index abf4435..78b76f3 100644 --- a/t/lib/Test/Sietima/MailStore.pm +++ b/t/lib/Test/Sietima/MailStore.pm @@ -1,7 +1,7 @@ package Test::Sietima::MailStore; use strict; use warnings; -use 5.020; +use 5.024; use Moo; use List::AllUtils qw(all); use namespace::clean; @@ -19,7 +19,7 @@ sub store { my ($self,$mail,@tags) = @_; my $id = time(); - push @{$self->_mails}, { + push $self->_mails->@*, { id => $id, mail => $mail->as_string, tags => { map {$_ => 1;} @tags, }, @@ -31,7 +31,7 @@ sub retrieve_by_tags { my ($self,@tags) = @_; my @ret; - for my $m (@{$self->_mails}) { + for my $m ($self->_mails->@*) { next unless all { $m->{tags}{$_} } @tags; push @ret, { %{$m}{id}, @@ -45,7 +45,7 @@ sub retrieve_by_tags { sub retrieve_by_id { my ($self,$id) = @_; - for my $m (@{$self->_mails}) { + for my $m ($self->_mails->@*) { next unless $m->{id} eq $id; return Email::MIME->new($m->{mail}); } -- cgit v1.2.3