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   54 use strict;
  9         17  
  9         213  
4 9     9   43 use warnings;
  9         19  
  9         197  
5 9     9   45 use RPerl::AfterSubclass;
  9         20  
  9         1196  
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   61 use parent qw(RPerl::DataType);
  9         16  
  9         49  
15 9     9   494 use RPerl::DataType;
  9         18  
  9         254  
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   40 use strict;
  9         19  
  9         167  
23 9     9   38 use warnings;
  9         21  
  9         280  
24 9     9   50 use parent -norequire, qw(ref);
  9         19  
  9         45  
25              
26             # [[[ SWITCH CONTEXT BACK TO PRIMARY PACKAGE ]]]
27             package RPerl::DataType::FileHandle;
28 9     9   393 use strict;
  9         23  
  9         161  
29 9     9   46 use warnings;
  9         22  
  9         227  
30              
31             # [[[ OO INHERITANCE ]]]
32 9     9   45 use parent qw(RPerl::DataType);
  9         16  
  9         43  
33 9     9   492 use RPerl::DataType;
  9         21  
  9         1623  
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