blib/lib/WordList/Test/Dynamic/OneTwo_Each.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 16 | 16 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | 3 | 3 | 100.0 |
subroutine | 5 | 5 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 27 | 27 | 100.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package WordList::Test::Dynamic::OneTwo_Each; | ||||||
2 | |||||||
3 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | ||||||
4 | our $DATE = '2021-02-23'; # DATE | ||||||
5 | our $DIST = 'WordList'; # DIST | ||||||
6 | our $VERSION = '0.7.8'; # VERSION | ||||||
7 | |||||||
8 | 1 | 1 | 2486 | use strict; | |||
1 | 2 | ||||||
1 | 36 | ||||||
9 | |||||||
10 | 1 | 1 | 6 | use WordList; | |||
1 | 2 | ||||||
1 | 43 | ||||||
11 | our @ISA = qw(WordList); | ||||||
12 | |||||||
13 | 1 | 1 | 508 | use Role::Tiny::With; | |||
1 | 5538 | ||||||
1 | 88 | ||||||
14 | with 'WordListRole::FirstNextResetFromEach'; | ||||||
15 | |||||||
16 | our $DYNAMIC = 1; | ||||||
17 | |||||||
18 | sub each_word { | ||||||
19 | 1 | 1 | 7 | no warnings 'numeric'; | |||
1 | 3 | ||||||
1 | 125 | ||||||
20 | |||||||
21 | 22 | 22 | 1 | 2947 | my ($self, $code) = @_; | ||
22 | |||||||
23 | 22 | 46 | for ("one", "two") { | ||||
24 | 38 | 81 | my $ret = $code->($_); | ||||
25 | 38 | 100 | 100 | 173 | return undef if defined $ret && $ret == -2; | ||
26 | } | ||||||
27 | } | ||||||
28 | |||||||
29 | our %STATS = ("num_words_contain_unicode",0,"shortest_word_len",3,"num_words_contains_whitespace",0,"longest_word_len",3,"avg_word_len",3,"num_words",2,"num_words_contain_whitespace",0,"num_words_contains_unicode",0,"num_words_contains_nonword_chars",0,"num_words_contain_nonword_chars",0); # STATS | ||||||
30 | |||||||
31 | 1; | ||||||
32 | # ABSTRACT: Wordlist that returns one, two (via implementing each_word()) | ||||||
33 | |||||||
34 | __END__ |