The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
use strict;
use warnings;
use Test::More tests => 3;

BEGIN { use_ok('List::Vectorize') }

my $a = ["a", "a", "a", "b", "b", "b", "c", "c"];
my $t = table($a);

is_deeply($t, {a => 3,
               b => 3,
			   c => 2});

my $b = [1, 1, 2, 2, 1, 1, 2, 2];
$t = table($a, $b);

is_deeply($t, {'a|1' => 2,
               'a|2' => 1,
			   'b|1' => 2,
			   'b|2' => 1,
			   'c|2' => 2});