File Coverage

blib/lib/RPerl/DataType/FileHandle.pm
Criterion Covered Total %
statement 36 52 69.2
branch 0 8 0.0
condition n/a
subroutine 12 14 85.7
pod n/a
total 48 74 64.8


line stmt bran cond sub pod time code
1             # [[[ HEADER ]]]
2             package RPerl::DataType::FileHandle;
3 7     7   41 use strict;
  7         12  
  7         158  
4 7     7   29 use warnings;
  7         10  
  7         136  
5 7     7   30 use RPerl::AfterSubclass;
  7         14  
  7         888  
6             our $VERSION = 0.004_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 7     7   45 use parent qw(RPerl::DataType);
  7         15  
  7         38  
15 7     7   340 use RPerl::DataType;
  7         12  
  7         159  
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 7     7   27 use strict;
  7         11  
  7         115  
23 7     7   30 use warnings;
  7         11  
  7         208  
24 7     7   32 use parent -norequire, qw(ref);
  7         12  
  7         30  
25              
26             # [[[ SWITCH CONTEXT BACK TO PRIMARY PACKAGE ]]]
27             package RPerl::DataType::FileHandle;
28 7     7   316 use strict;
  7         17  
  7         156  
29 7     7   32 use warnings;
  7         14  
  7         179  
30              
31             # [[[ OO INHERITANCE ]]]
32 7     7   32 use parent qw(RPerl::DataType);
  7         14  
  7         22  
33 7     7   339 use RPerl::DataType;
  7         17  
  7         1295  
34              
35             # NEED FIX: is a filehandleref really an integer?!?
36              
37             # [[[ TYPE-CHECKING ]]]
38             sub filehandleref_CHECK {
39 0     0     { my void $RETURN_TYPE };
  0            
40 0           ( my $possible_filehandleref ) = @ARG;
41 0 0         if ( not( defined $possible_filehandleref ) ) {
42             # croak( "\nERROR EFH00, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but undefined/null value found,\ncroaking" );
43 0           die( "\nERROR EFH00, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but undefined/null value found,\ndying\n" );
44             }
45 0 0         if ( not( main::RPerl_SvIOKp($possible_filehandleref) ) ) {
46             # croak( "\nERROR EFH01, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but non-filehandleref value found,\ncroaking" );
47 0           die( "\nERROR EFH01, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but non-filehandleref value found,\ndying\n" );
48             }
49 0           return;
50             }
51              
52             sub filehandleref_CHECKTRACE {
53 0     0     { my void $RETURN_TYPE };
  0            
54 0           ( my $possible_filehandleref, my $variable_name, my $subroutine_name ) = @ARG;
55 0 0         if ( not( defined $possible_filehandleref ) ) {
56             # croak( "\nERROR EFH00, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but undefined/null value found,\nin variable $variable_name from subroutine $subroutine_name,\ncroaking" );
57 0           die( "\nERROR EFH00, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but undefined/null value found,\nin variable $variable_name from subroutine $subroutine_name,\ndying\n" );
58             }
59 0 0         if ( not( main::RPerl_SvIOKp($possible_filehandleref) ) ) {
60             # croak( "\nERROR EFH01, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but non-filehandleref value found,\nin variable $variable_name from subroutine $subroutine_name,\ncroaking" );
61 0           die( "\nERROR EFH01, TYPE-CHECKING MISMATCH, PERLOPS_PERLTYPES:\nfilehandleref value expected but non-filehandleref value found,\nin variable $variable_name from subroutine $subroutine_name,\ndying\n" );
62             }
63 0           return;
64             }
65              
66             1; # end of class