1use Test::More qw(no_plan);
2use strict;
3use warnings;
4
5use autobox::Core;
6
7my @array = qw(foo bar baz);
8
9my @returned = @array->sort;
10
11is_deeply \@returned, [qw(bar baz foo)];
12
13@returned = @array->sort(sub { $_[1] cmp $_[0] });
14
15is_deeply \@returned, [qw(foo baz bar)];
16
17my $arrayref = @array->sort;
18
19is ref $arrayref, "ARRAY", "Returns an arrayref in scalar context";
20