### ----------------------------------------------------
### -- Code::Coverable
### -- Licenses: Artistic-2.0
### -- Authors: Elizabeth Mattijsen
### -- File: t/02-identity.rakutest
### ----------------------------------------------------
use Test;

use Code::Coverable;

# All (in)direct dependencies that should be installed
my @targets = <
  Identity::Utils List::Agnostic META::verauthapi MoarVM::Bytecode
  paths String::Utils Test
>;
my @min-elems = 130,10,10,560,80,220,460;  # heuristic

plan 2 * @targets;

my %map = coverables(@targets, :raw).map: { .key => $_ }

my @keys = @targets.map: -> $target {
    %map.keys.first: *.ends-with("($target)")
}

for @targets.kv -> $index, $target {
    my $cc  = %map{@keys[$index]};
    is $cc.target, $target, "did we get '$target' as target";

    my $min-elems = @min-elems[$index];
    my $elems     = $cc.line-numbers.elems;
    ok $elems >= $min-elems, "$elems >= $min-elems for '$target'";
}

# vim: expandtab shiftwidth=4


