CLI/Argument/Number/Float.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 29 CC 2 SCAR 11.5
CC
2
Cov
0%
coerce_value
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.1
1 #=============================================================================
2 #
3 # Module: Term::CLI::Argument::Number::Float
4 #
5 # Description: Class for floating point arguments in Term::CLI
6 #
7 # Author: Steven Bakker (SBAKKER), <sbakker@cpan.org>
8 # Created: 22/01/18
9 #
10 # Copyright (c) 2018 Steven Bakker
11 #
12 # This module is free software; you can redistribute it and/or modify
13 # it under the same terms as Perl itself. See "perldoc perlartistic."
14 #
15 # This software is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 #
19 #=============================================================================
20  
21 use 5.014_001;
22  
23 package Term::CLI::Argument::Number::Float 0.051003 {
24  
25 use Modern::Perl 1.20140107;
26 use Scalar::Util 1.38 qw( looks_like_number );
27  
28 use Moo 1.000001;
29 use namespace::clean 0.25;
30  
31 extends 'Term::CLI::Argument::Number';
32  
33 sub coerce_value {
34 if (looks_like_number($_[1])) {
35 return $_[1] + 0.0;
36 }
37 return undef;
38 }
39  
40 }
41  
42 1;
43  
44 __END__