File Coverage

blib/lib/SpeL/Object/Log.pm
Criterion Covered Total %
statement 19 20 95.0
branch 5 6 83.3
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 30 32 93.7


line stmt bran cond sub pod time code
1             # -*- cperl -*-
2             # ABSTRACT: LaTeX logarithm object
3              
4              
5             package SpeL::Object::Log;
6              
7 41     41   276 use parent 'Exporter';
  41         86  
  41         282  
8 41     41   2945 use Carp;
  41         86  
  41         2532  
9              
10 41     41   1572 use SpeL::I18n;
  41         592  
  41         1193  
11              
12 41     41   209 use Data::Dumper;
  41         175  
  41         8454  
13              
14              
15              
16             sub read {
17 6     6 1 8 my $self = shift;
18 6         10 my ( $level ) = @_;
19              
20             # say STDERR Data::Dumper->Dump( [ $self ], [ 'self' ] );
21 6 100       21 if( $self->{Op} eq 'log' ) {
    50          
22 4 100       10 if( exists $self->{base} ) {
23 3         19 return $SpeL::I18n::lh->maketext( 'logn', $self->{base}->read( $level + 1 ) );
24             }
25             else {
26 1         3 return $SpeL::I18n::lh->maketext( 'log' );
27             }
28             }
29             elsif( $self->{Op} eq 'ln' ) {
30 2         5 return $SpeL::I18n::lh->maketext( 'ln' );
31             }
32             else {
33 0           die( "Internal error in Log.pm");
34             }
35             }
36              
37             1;
38              
39             __END__