File Coverage

blib/lib/SQL/Statement/Function/ByName/YEAR.pm
Criterion Covered Total %
statement 11 11 100.0
branch 2 2 100.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 17 18 94.4


line stmt bran cond sub pod time code
1             package SQL::Statement::Function::ByName::YEAR;
2              
3             our $DATE = '2017-01-25'; # DATE
4             our $VERSION = '0.04'; # VERSION
5              
6 1     1   1313 use 5.010001;
  1         3  
7 1     1   4 use strict;
  1         2  
  1         20  
8 1     1   4 use warnings;
  1         1  
  1         81  
9              
10             sub SQL_FUNCTION_YEAR {
11 3     3 0 12 my $param = $_[2];
12              
13 3 100       16 $param =~ /^(\d{4})-/ or return undef;
14 2         10 $1;
15             }
16              
17             1;
18             # ABSTRACT: YEAR() SQL function
19              
20             __END__