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