DBO/Visitor/CheckKeys.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 3 Podpod n/a totaltotal 0.0% 0 / 21 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #------------------------------------------------------------------------------
2 # DBO::Visitor::CheckKeys - check key fields for validity
3 #
4 # DESCRIPTION
5 # A visitor class that checks the key fields of a record (represented
6 # as a hash mapping column name to value) for validity.
7 #
8 # AUTHOR
9 # Gareth Rees
10 #
11 # COPYRIGHT
12 # Copyright (c) 1999 Canon Research Centre Europe Ltd/
13 #
14 # $Id: CheckKeys.pm,v 1.1 1999/06/14 17:05:21 garethr Exp $
15 #------------------------------------------------------------------------------
16  
17 use strict;
18 package DBO::Visitor::CheckKeys;
19 use base qw(DBO::Visitor::Check);
20 use Class::Multimethods;
21  
22 multimethod visit_table =>
23 qw(DBO::Visitor::CheckKeys DBO::Table DBO::Handle) =>
24 sub {
25 my ($vis, $table, $handle) = @_;
26 foreach my $col (@{$table->{keys}}) {
27 visit_column($vis, $col, $handle) or return 0;
28 }
29 return 1;
30 };
31  
32 1;