File Coverage

blib/lib/WordList/Test/Dynamic/OneTwo_Each.pm
Criterion Covered Total %
statement 16 16 100.0
branch 2 2 100.0
condition 2 3 66.6
subroutine 5 5 100.0
pod 1 1 100.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package WordList::Test::Dynamic::OneTwo_Each;
2              
3 1     1   2293 use strict;
  1         3  
  1         32  
4              
5 1     1   5 use WordList;
  1         2  
  1         41  
6             our @ISA = qw(WordList);
7              
8 1     1   464 use Role::Tiny::With;
  1         5159  
  1         151  
9             with 'WordListRole::FirstNextResetFromEach';
10              
11             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
12             our $DATE = '2021-09-26'; # DATE
13             our $DIST = 'WordList'; # DIST
14             our $VERSION = '0.7.11'; # VERSION
15              
16             our $DYNAMIC = 1;
17              
18             sub each_word {
19 1     1   8 no warnings 'numeric';
  1         3  
  1         123  
20              
21 22     22 1 2724 my ($self, $code) = @_;
22              
23 22         47 for ("one", "two") {
24 38         80 my $ret = $code->($_);
25 38 100 66     170 return undef if defined $ret && $ret == -2; ## no critic: Subroutines::ProhibitExplicitReturnUndef
26             }
27             }
28              
29             our %STATS = ("num_words_contains_unicode",0,"num_words_contains_nonword_chars",0,"shortest_word_len",3,"num_words_contains_whitespace",0,"num_words_contain_unicode",0,"num_words_contain_nonword_chars",0,"num_words",2,"longest_word_len",3,"avg_word_len",3,"num_words_contain_whitespace",0); # STATS
30              
31             1;
32             # ABSTRACT: Wordlist that returns one, two (via implementing each_word())
33              
34             __END__