File Coverage

blib/lib/Acme/BeyondPerl/ToSQL/SQLite.pm
Criterion Covered Total %
statement 29 30 96.6
branch n/a
condition n/a
subroutine 17 18 94.4
pod 0 1 0.0
total 46 49 93.8


line stmt bran cond sub pod time code
1             package Acme::BeyondPerl::ToSQL::SQLite;
2              
3 1     1   5 use strict;
  1         2  
  1         62  
4 1     1   6 use base qw(Acme::BeyondPerl::ToSQL);
  1         2  
  1         443  
5              
6             our $VERSION = 0.01;
7              
8             my $OPs = {
9 4     4   35 '+' => sub { shift->add(@_) },
10 7     7   39 '-' => sub { shift->sub(@_) },
11 2     2   251 '*' => sub { shift->mul(@_) },
12 1     1   11 '/' => sub { shift->div(@_) },
13 1     1   9 '%' => sub { shift->mod(@_) },
14 0     0   0 'abs' => sub { shift->abs(@_) },
15 1     1   11 '<<' => sub { shift->lshift(@_) },
16 1     1   9 '>>' => sub { shift->rshift(@_) },
17 2     2   13 '&' => sub { shift->and(@_) },
18 2     2   13 '|' => sub { shift->or(@_) },
19             };
20              
21 1     1 0 3 sub ops { return $OPs; }
22              
23             ##############################################################################
24             #
25             ##############################################################################
26              
27             package Acme::BeyondPerl::ToSQL::SQLite::__Integer;
28              
29 1     1   5 use base qw(Acme::BeyondPerl::ToSQL::SQLite);
  1         2  
  1         103  
30              
31 20     20   25 sub as_sql { sprintf("%.1f", ${$_[0]}); }
  20         154  
32              
33             ##############################################################################
34             #
35             ##############################################################################
36              
37             package Acme::BeyondPerl::ToSQL::SQLite::__Float;
38              
39 1     1   10 use base qw(Acme::BeyondPerl::ToSQL::SQLite);
  1         1  
  1         52  
40 1     1   15 use strict;
  1         2  
  1         60  
41              
42 8     8   15 sub as_sql { sprintf("%.16f", ${$_[0]}); }
  8         73  
43              
44             ##############################################################################
45             1;
46             __END__