<commit_before>use v6;
use Pod::Coverage;
use Test;

unit module Test::Coverage;


#| TAP for Pod::Coverage
sub coverage_ok($metafile) is export {    
    
    coverage($metafile, False)
        
}

#| same as C<coverage_ok>
sub subtest_coverage_ok($metafile, $identity =  "POD coverage") is export {

    subtest {        
        coverage_ok($metafile);     
    }, $identity;
}

#| Subtest version of C<anypod_ok>
sub subtest_anypod_ok($metafile, $identity = "any POD coverage") is export {
    subtest {
       anypod_ok($metafile);     
    }, $identity;
}

#| Checks if provides contain any pod
sub anypod_ok($metafile) {
    coverage($metafile,True);
}

sub coverage($metafile, $anypod) {
    my @cases = Pod::Coverage.use-meta($metafile);
    plan @cases.elems;
    for @cases -> $case {
        my $result = $case.are-missing;
        my $what = $case.packageStr ~ " POD coverage";
        if $result {
            $what = $what ~ "\n" ~  $case.get-results.join("\n");
        }
        nok $result, $what;
    }    
}
<commit_msg>Fix testing anypod<commit_after>use v6;
use Pod::Coverage;
use Test;

unit module Test::Coverage;


#| TAP for Pod::Coverage
sub coverage_ok($metafile) is export {    
    
    coverage($metafile, False)
        
}

#| same as C<coverage_ok>
sub subtest_coverage_ok($metafile, $identity =  "POD coverage") is export {

    subtest {        
        coverage_ok($metafile);     
    }, $identity;
}

#| Subtest version of C<anypod_ok>
sub subtest_anypod_ok($metafile, $identity = "any POD coverage") is export {
    subtest {
       anypod_ok($metafile);     
    }, $identity;
}

#| Checks if provides contain any pod
sub anypod_ok($metafile) {
    coverage($metafile,True);
}

sub coverage($metafile, $anypod) {
    my @cases = Pod::Coverage.use-meta($metafile, $anypod);
    plan @cases.elems;
    for @cases -> $case {
        my $result = $case.are-missing;
        my $what = $case.packageStr ~ " POD coverage";
        if $result {
            $what = $what ~ "\n" ~  $case.get-results.join("\n");
        }
        nok $result, $what;
    }    
}

{'fraction_non_alphanumeric': 0.1413562559694365, 'fraction_numerical': 0.0009551098376313276, 'mean_word_length': 2.6498257839721253, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1266726', 'n_tokens_mistral': 738, 'n_tokens_neox': 731, 'n_words': 169}