File Coverage

blib/lib/RPerl/DataType/FileHandle.pm
Criterion Covered Total %
statement 36 46 78.2
branch 0 8 0.0
condition n/a
subroutine 12 14 85.7
pod 0 2 0.0
total 48 70 68.5


line stmt bran cond sub pod time code
1             # [[[ HEADER ]]]
2             package RPerl::DataType::FileHandle;
3 9     9   56 use strict;
  9         22  
  9         221  
4 9     9   48 use warnings;
  9         18  
  9         206  
5 9     9   48 use RPerl::AfterSubclass;
  9         19  
  9         1227  
6             our $VERSION = 0.003_000;
7              
8             # [[[ CRITICS ]]]
9             ## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
10             ## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils
11             ## no critic qw(Capitalization ProhibitMultiplePackages ProhibitReusedNames) # SYSTEM DEFAULT 3: allow multiple & lower case package names
12              
13             # [[[ OO INHERITANCE ]]]
14 9     9   60 use parent qw(RPerl::DataType);
  9         19  
  9         52  
15 9     9   502 use RPerl::DataType;
  9         23  
  9         278  
16              
17             # [[[ SUB-TYPES BEFORE SETUP ]]]
18             # a filehandleref is "a reference to a newly allocated anonymous filehandle"; http://perldoc.perl.org/functions/open.html
19             # we do not ever directly use filehandle type, only filehandleref
20             package # hide from PAUSE indexing
21             filehandleref;
22 9     9   50 use strict;
  9         19  
  9         188  
23 9     9   103 use warnings;
  9         23  
  9         322  
24 9     9   55 use parent -norequire, qw(ref);
  9         19  
  9         56  
25              
26             # [[[ SWITCH CONTEXT BACK TO PRIMARY PACKAGE ]]]
27             package RPerl::DataType::FileHandle;
28 9     9   475 use strict;
  9         22  
  9         194  
29 9     9   47 use warnings;
  9         22  
  9         277  
30              
31             # [[[ OO INHERITANCE ]]]
32 9     9   50 use parent qw(RPerl::DataType);
  9         19  
  9         34  
33 9     9   512 use RPerl::DataType;
  9         26  
  9         1736  
34              
35             # NEED FIX: is a filehandleref really an integer?!?
36              
37             # [[[ TYPE-CHECKING ]]]
38             #our void $filehandleref_CHECK = sub {
39             sub filehandleref_CHECK {
40 0     0 0   ( my $possible_filehandleref ) = @_;
41 0 0         if ( not( defined $possible_filehandleref ) ) {
42 0           croak(
43             "\nERROR EFH00, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but undefined/null value found,\ncroaking"
44             );
45             }
46 0 0         if ( not( main::RPerl_SvIOKp($possible_filehandleref) ) ) {
47 0           croak(
48             "\nERROR EFH01, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but non-filehandleref value found,\ncroaking"
49             );
50             }
51             }
52              
53             #our void $filehandleref_CHECKTRACE = sub {
54             sub filehandleref_CHECKTRACE {
55 0     0 0   ( my $possible_filehandleref, my $variable_name, my $subroutine_name )
56             = @_;
57 0 0         if ( not( defined $possible_filehandleref ) ) {
58 0           croak(
59             "\nERROR EFH00, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but undefined/null value found,\nin variable $variable_name from subroutine $subroutine_name,\ncroaking"
60             );
61             }
62 0 0         if ( not( main::RPerl_SvIOKp($possible_filehandleref) ) ) {
63 0           croak(
64             "\nERROR EFH01, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but non-filehandleref value found,\nin variable $variable_name from subroutine $subroutine_name,\ncroaking"
65             );
66             }
67             }
68              
69             1; # end of class