### ----------------------------------------------------
### -- List::MoreUtils
### -- Licenses: Artistic-2.0
### -- Authors: Elizabeth Mattijsen
### -- File: t/reduce_0.rakutest
### ----------------------------------------------------
use Test;
use List::MoreUtils <reduce_0>;

plan 1;

{
    my @exam_results = 2, 4, 6, 5, 3, 0;
    my $pupil = @exam_results.sum;
    my $wa = reduce_0 -> $a, $b { $a + ++$ * $b / $pupil }, @exam_results;
    is $wa, 3.15, "weighted average of exam";
}

# vim: expandtab shiftwidth=4


