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   3471 use 5.006002;
  1         3  
4              
5 1     1   3 use strict;
  1         1  
  1         31  
6 1     1   3 use warnings;
  1         1  
  1         61  
7              
8             our $VERSION = '0.133';
9              
10 1     1   4 use Exporter qw{ import };
  1         0  
  1         31  
11              
12 1     1   3 use Astro::Coord::ECI::TLE qw{ :constants };
  1         1  
  1         181  
13 1     1   5 use Astro::Coord::ECI::Utils qw{ rad2deg };
  1         2  
  1         43  
14 1     1   4 use Test::More 0.88;
  1         13  
  1         6  
15              
16 1     1   267 use constant CODE_REF => ref sub {};
  1         1  
  1         257  
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 4913 my ( $tle, @arg ) = @_;
27 4         12 my ( $time, $want, $name ) = splice @arg, -3;
28 4         4 my $got;
29             eval {
30 4         18 $got = $tle->universal( $time )->magnitude( @arg );
31 4 50       27 defined $got
32             and $got = sprintf '%.1f', $got;
33 4         8 1;
34 4 50       4 } or do {
35 0         0 @_ = "$name failed: $@";
36 0         0 goto &fail;
37             };
38 4 50       7 if ( defined $want ) {
39 4         8 $want = sprintf '%.1f', $want;
40 4         9 @_ = ( $got, 'eq', $want, $name );
41 4         14 goto &cmp_ok;
42             } else {
43 0           @_ = ( ! defined $got, $name );
44 0           goto &ok;
45             }
46             }
47              
48             1;
49              
50             __END__