File Coverage

blib/lib/Iterator/Flex/Role/Exhaustion/Return.pm
Criterion Covered Total %
statement 32 32 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 2 2 100.0
total 44 44 100.0


line stmt bran cond sub pod time code
1             package Iterator::Flex::Role::Exhaustion::Return;
2              
3             # ABSTRACT: signal exhaustion by returning a sentinel value.
4              
5 30     30   237911 use v5.28;
  30         141  
6 30     30   216 use strict;
  30         62  
  30         808  
7 30     30   133 use warnings;
  30         57  
  30         2052  
8              
9             our $VERSION = '0.33';
10              
11 30     30   172 use Scalar::Util();
  30         65  
  30         785  
12 30     30   595 use Iterator::Flex::Utils qw[ :default REG_GENERAL REG_GP_EXHAUSTION ];
  30         60  
  30         4423  
13 30     30   904 use Role::Tiny;
  30         8078  
  30         193  
14 30     30   12097 use experimental 'signatures';
  30         67  
  30         247  
15              
16 30     30   5760 use namespace::clean;
  30         17062  
  30         250  
17              
18              
19              
20              
21              
22              
23              
24              
25              
26 466     466 1 713 sub sentinel ( $self ) {
  466         739  
  466         3333  
27 466         2509 return $REGISTRY{ refaddr $self }[REG_GENERAL][REG_GP_EXHAUSTION][1];
28             }
29              
30              
31              
32              
33              
34              
35              
36              
37              
38              
39 465     465 1 760 sub signal_exhaustion ( $self, @ ) {
  465         816  
  465         669  
40 465         1986 $self->set_exhausted;
41 465         1226 return $self->sentinel;
42             }
43              
44              
45             1;
46              
47             #
48             # This file is part of Iterator-Flex
49             #
50             # This software is Copyright (c) 2018 by Smithsonian Astrophysical Observatory.
51             #
52             # This is free software, licensed under:
53             #
54             # The GNU General Public License, Version 3, June 2007
55             #
56              
57             __END__