File Coverage

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-06-23'; # DATE
5             our $DIST = 'WordList'; # DIST
6             our $VERSION = '0.7.10'; # VERSION
7              
8 1     1   2047 use strict;
  1         2  
  1         30  
9              
10 1     1   4 use WordList;
  1         2  
  1         35  
11             our @ISA = qw(WordList);
12              
13 1     1   421 use Role::Tiny::With;
  1         4507  
  1         110  
14             with 'WordListRole::FirstNextResetFromEach';
15              
16             our $DYNAMIC = 1;
17              
18             sub each_word {
19 1     1   7 no warnings 'numeric';
  1         2  
  1         105  
20              
21 22     22 1 2499 my ($self, $code) = @_;
22              
23 22         40 for ("one", "two") {
24 38         69 my $ret = $code->($_);
25 38 100 100     139 return undef if defined $ret && $ret == -2;
26             }
27             }
28              
29             our %STATS = ("shortest_word_len",3,"num_words_contains_unicode",0,"num_words_contain_nonword_chars",0,"longest_word_len",3,"num_words",2,"num_words_contain_whitespace",0,"num_words_contains_nonword_chars",0,"avg_word_len",3,"num_words_contain_unicode",0,"num_words_contains_whitespace",0); # STATS
30              
31             1;
32             # ABSTRACT: Wordlist that returns one, two (via implementing each_word())
33              
34             __END__