SQLEngine/Criteria/Not.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 32 CC 2 SCAR 12.8
CC
2
Cov
0%
sql_where
6.0
new
2.0
BEGIN
2.0
CRAP 3.6
1 package DBIx::SQLEngine::Criteria::Not;
2  
3 @ISA = 'DBIx::SQLEngine::Criteria';
4 use strict;
5 use Carp;
6  
7 sub new {
8 my $package = shift;
9 ( @_ < 2 ) or croak("The Not criteria only accepts one argument");
10 bless [ shift ], $package;
11 }
12  
13 sub sql_where {
14 my $self = shift;
15 my ($clause, @params) = $self->[0]->sql_where;
16
17 return unless defined $clause and length $clause;
18
19 return ( " NOT ( " . $clause . " ) ", @params )
20 }
21  
22 1;
23  
24 __END__