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 => 1+2*20;
BEGIN { use_ok('Statistics::Test::Sequence') };

my @fac = qw(
1
2
6
24
120
720
5040
40320
362880
3628800
39916800
479001600
6227020800
87178291200
1307674368000
20922789888000
355687428096000
6402373705728000
121645100408832000
2432902008176640000
);

foreach (1..2) {
    my $msg = '';
    $msg = ' ... memoized' if $_ ==2;
    foreach (1..@fac) {
        is(
            $fac[$_-1], Statistics::Test::Sequence::faculty($_),
            "faculty($_)$msg"
        );
    }
}