sub all {
my ($array) = @_;
- return Perl6::Junction::All->new(@$array);
+ return Perl6::Junction::all(@$array);
}
sub any {
my ($array) = @_;
- return Perl6::Junction::Any->new(@$array);
+ return Perl6::Junction::any(@$array);
}
sub none {
my ($array) = @_;
- return Perl6::Junction::None->new(@$array);
+ return Perl6::Junction::none(@$array);
}
sub one {
my ($array) = @_;
- return Perl6::Junction::One->new(@$array);
+ return Perl6::Junction::one(@$array);
}
## Print
use strict;
use warnings;
-use Test::More tests => 64;
+use Test::More tests => 68;
BEGIN {
use_ok('Moose::Autobox');
$a->perl,
'... the value is correctly dumped with perl()' );
+is([1, 2, 3, 4, 5]->any, 3, '... any correctly found a value');
+is([1, 1, 2, 3, 4, 5, 5]->one, 2, '... one correctly found one value');
+is([1, 1, 2, 3, 4, 5, 5]->none , 6, '... none correctly did not find any of a value');
+is([3, 3, 3]->all, 3, '... all correctly found all of a value');
# Hash