The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
use strict;
use warnings;

use Test::More;
use List::UtilsBy::XS qw( uniq_by );

my $expected;
my @gots;
my @array;

is_deeply( [ uniq_by { } ], [], 'empty list' );

is_deeply( [ uniq_by { $_ } "a" ], [ "a" ], 'unit list' );

@gots = uniq_by { $_ } "a", "b";
is_deeply(\@gots, [ "a", "b" ],'identity function no-op');

@gots = uniq_by { $_ } "b", "a";
is_deeply(\@gots, [ "b", "a" ], 'identity function on $_' );

@gots = uniq_by { length $_ } "a", "b", "cc", "dd", "eee";
is_deeply(\@gots, [ "a", "cc", "eee" ], 'length function' );

done_testing;