File Coverage

inc/My/Module/Test.pm
Criterion Covered Total %
statement 34 38 89.4
branch 3 6 50.0
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 47 54 87.0


line stmt bran cond sub pod time code
1             package My::Module::Test;
2              
3 1     1   2238 use 5.006002;
  1         2  
4              
5 1     1   4 use strict;
  1         2  
  1         16  
6 1     1   4 use warnings;
  1         1  
  1         39  
7              
8             our $VERSION = '0.131';
9              
10 1     1   4 use Exporter qw{ import };
  1         1  
  1         23  
11              
12 1     1   4 use Astro::Coord::ECI::TLE qw{ :constants };
  1         2  
  1         156  
13 1     1   6 use Astro::Coord::ECI::Utils qw{ rad2deg };
  1         2  
  1         42  
14 1     1   5 use Test::More 0.88;
  1         24  
  1         8  
15              
16 1     1   273 use constant CODE_REF => ref sub {};
  1         2  
  1         250  
17              
18             our @EXPORT_OK = qw{
19             magnitude
20             };
21             our %EXPORT_TAGS = (
22             all => \@EXPORT_OK,
23             );
24              
25             sub magnitude {
26 4     4 1 4045 my ( $tle, @arg ) = @_;
27 4         12 my ( $time, $want, $name ) = splice @arg, -3;
28 4         5 my $got;
29             eval {
30 4         14 $got = $tle->universal( $time )->magnitude( @arg );
31 4 50       35 defined $got
32             and $got = sprintf '%.1f', $got;
33 4         9 1;
34 4 50       6 } or do {
35 0         0 @_ = "$name failed: $@";
36 0         0 goto &fail;
37             };
38 4 50       11 if ( defined $want ) {
39 4         12 $want = sprintf '%.1f', $want;
40 4         14 @_ = ( $got, 'eq', $want, $name );
41 4         19 goto &cmp_ok;
42             } else {
43 0           @_ = ( ! defined $got, $name );
44 0           goto &ok;
45             }
46             }
47              
48             1;
49              
50             __END__