| 1 | 419 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | package HTML::FormFu::Role::FormAndBlockMethods; | ||||||||||||||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: role for form and block methods | ||||||||||||||||||||||||||||||||||||||||||||
| 5 | 419 | $HTML::FormFu::Role::FormAndBlockMethods::VERSION = '2.09'; | |||||||||||||||||||||||||||||||||||||||||||
| 6 | 419 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||
| 8 | 419 | ▶ | use HTML::FormFu::Util qw( _merge_hashes ); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 9 | 419 | ▶ | use Carp qw( croak ); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 10 | 419 | ▶ | use List::Util 1.33 qw( none ); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2449 | ▶ | sub default_args { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_args: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 13 | 2449 | my ( $self, $defaults ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||
| 15 | 2449 | ▶ | $self->{default_args} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"default_args"} ||= {}
MC/DC100%1/1
$self->{"default_args"} ||= {}
$self->{"default_args"}
Truth table100%2/2
A
A= $self->{"default_args"}
| |||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | 2449 | ▶ | if ($defaults) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | 111 | my @valid_types = qw( | |||||||||||||||||||||||||||||||||||||||||||
| 20 | elements deflators | ||||||||||||||||||||||||||||||||||||||||||||
| 21 | filters constraints | ||||||||||||||||||||||||||||||||||||||||||||
| 22 | inflators validators | ||||||||||||||||||||||||||||||||||||||||||||
| 23 | transformers output_processors | ||||||||||||||||||||||||||||||||||||||||||||
| 24 | ); | ||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||
| 26 | 111 | for my $type ( keys %$defaults ) { | |||||||||||||||||||||||||||||||||||||||||||
| 27 | croak "not a valid type for default_args: '$type'" | ||||||||||||||||||||||||||||||||||||||||||||
| 28 | 131 | ▶ | if none { $type eq $_ } @valid_types; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | $self->{default_args} | ||||||||||||||||||||||||||||||||||||||||||||
| 32 | 111 | = _merge_hashes( $self->{default_args}, $defaults ); | |||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||
| 35 | 2449 | return $self->{default_args}; | |||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | sub constraints_from_dbic { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
constraints_from_dbic: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | my ( $self, $source, $map ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | if ( 2 == @_ && 'ARRAY' eq ref $source ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
2 == @_ and "ARRAY" eq ref $source
MC/DC0%0/2
2 == @_ and "ARRAY" eq ref $source
2 == @_
"ARRAY" eq ref $source
Truth table0%0/3
A and B
A= 2 == @_B= "ARRAY" eq ref $source
| |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ( $source, $map ) = @$source; | |||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | $map ||= {}; | ||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$map ||= {}
MC/DC0%0/1
$map ||= {}
$map
Truth table0%0/2
A
A= $map
| |||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | $source = _result_source($source); | |||||||||||||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | for my $col ( $source->columns ) { | |||||||||||||||||||||||||||||||||||||||||||
| 50 | 0 | _add_constraints( $self, $col, $source->column_info($col) ); | |||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | for my $col ( keys %$map ) { | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | my $source = _result_source( $map->{$col} ); | |||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||
| 56 | 0 | _add_constraints( $self, $col, $source->column_info($col) ); | |||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | sub _result_source { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_result_source: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | my ($source) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | ▶ | if ( blessed $source ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | $source = $source->result_source; | |||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||
| 69 | 0 | return $source; | |||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | sub _add_constraints { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraints: not called CC=16 SCAR=56.1
| |||||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | my ( $self, $col, $info ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||
| 75 | # We need to ensure we're only using this Block's children, | ||||||||||||||||||||||||||||||||||||||||||||
| 76 | # as far as 'nested_name' is concerned. | ||||||||||||||||||||||||||||||||||||||||||||
| 77 | # But we can't use get_elements() in case the fields are in sub-Blocks | ||||||||||||||||||||||||||||||||||||||||||||
| 78 | # that don't have 'nested_name' set. | ||||||||||||||||||||||||||||||||||||||||||||
| 79 | |||||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | my $parent = $self; | |||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my @parent_names; | |||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | do { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | my $nested_name = $parent->nested_name; | |||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | ▶ | if ( defined $nested_name && length $nested_name ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $nested_name and length $nested_name
MC/DC0%0/2
defined $nested_name and length $nested_name
defined $nested_name
length $nested_name
Truth table0%0/3
A and B
A= defined $nested_nameB= length $nested_name
| |||||||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | push @parent_names, $nested_name; | |||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 88 | } while ( $parent = $parent->parent ); | ||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | my $fields = $self->get_fields($col); | |||||||||||||||||||||||||||||||||||||||||||
| 91 | 0 | ▶ | return if !@$fields; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | ▶ | if (@parent_names) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | my $pre = join ".", reverse @parent_names; | |||||||||||||||||||||||||||||||||||||||||||
| 95 | 0 | @$fields = grep { $_->nested_name eq "$pre." . $_->name } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 97 | else { | ||||||||||||||||||||||||||||||||||||||||||||
| 98 | 0 | @$fields = grep { $_->nested_name eq $_->name } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | return if !@$fields; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||||||||||||||||||
| 103 | 0 | ▶ | return if !defined $info->{data_type}; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 104 | |||||||||||||||||||||||||||||||||||||||||||||
| 105 | 0 | my $type = lc $info->{data_type}; | |||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||
| 107 | 0 | ▶ | if ( $type =~ /(char|text|binary)\z/ && defined $info->{size} ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
Condition0%0/3
$type =~ /(char|text|binary)\z/ and defined $info->{"size"}
MC/DC0%0/2
$type =~ /(char|text|binary)\z/ and defined $info->{"size"}
$type =~ /(char|text|binary)\z/
defined $info->{"size"}
Truth table0%0/3
A and B
A= $type =~ /(char|text|binary)\z/B= defined $info->{"size"}
| |||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||
| 109 | # char, varchar, *text, binary, varbinary | ||||||||||||||||||||||||||||||||||||||||||||
| 110 | 0 | _add_constraint_max_length( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 112 | elsif ( $type =~ /int/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 113 | 0 | _add_constraint_integer( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | ▶ | if ( $info->{extra}{unsigned} ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | _add_constraint_unsigned( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 119 | ▶ | elsif ( $type =~ /enum|set/ && defined $info->{extra}{list} ) { | |||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$type =~ /enum|set/ and defined $info->{"extra"}{"list"}
MC/DC0%0/2
$type =~ /enum|set/ and defined $info->{"extra"}{"list"}
$type =~ /enum|set/
defined $info->{"extra"}{"list"}
Truth table0%0/3
A and B
A= $type =~ /enum|set/B= defined $info->{"extra"}{"list"}
| |||||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | _add_constraint_set( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 122 | elsif ( $type =~ /bool/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 123 | 0 | _add_constraint_bool( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 124 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 125 | elsif ( $type =~ /decimal/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | _add_constraint_decimal( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 129 | |||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | sub _add_constraint_max_length { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_max_length: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my ( $self, $fields, $info ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||||||||||||||||||
| 133 | 0 | map { $_->constraint( { type => 'MaxLength', max => $info->{size}, } ) } | |||||||||||||||||||||||||||||||||||||||||||
| 134 | @$fields; | ||||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | sub _add_constraint_integer { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_integer: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 138 | 0 | my ( $self, $fields ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | map { $_->constraint( { type => 'Integer', } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | sub _add_constraint_unsigned { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_unsigned: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 144 | 0 | my ( $self, $fields ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||
| 146 | 0 | map { $_->constraint( { type => 'Range', min => 0, } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | sub _add_constraint_set { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_set: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | my ( $self, $fields, $info ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||
| 152 | 0 | map { $_->constraint( { type => 'Set', set => $info->{extra}{list}, } ) } | |||||||||||||||||||||||||||||||||||||||||||
| 153 | @$fields; | ||||||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | sub _add_constraint_bool { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_bool: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 157 | 0 | my ( $self, $fields ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||
| 159 | 0 | map { $_->constraint( { type => 'Set', set => [ 0, 1 ] } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | sub _add_constraint_decimal { | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_decimal: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 163 | 0 | my ( $self, $fields, $info ) = @_; | |||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | my $size = $info->{size}; | |||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | my $regex; | |||||||||||||||||||||||||||||||||||||||||||
| 167 | |||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | if ( defined $size ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | if ( 'ARRAY' eq ref $size && 2 == @$size ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition0%0/3
"ARRAY" eq ref $size and 2 == @$size
MC/DC0%0/2
"ARRAY" eq ref $size and 2 == @$size
"ARRAY" eq ref $size
2 == @$size
Truth table0%0/3
A and B
A= "ARRAY" eq ref $sizeB= 2 == @$size
| |||||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | my ( $i, $j ) = @$size; | |||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | $i -= $j; | |||||||||||||||||||||||||||||||||||||||||||
| 172 | 0 | $regex = qr/^ [0-9]{0,$i} (?: \. [0-9]{0,$j} )? \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 174 | ▶ | elsif ( 'ARRAY' eq ref $size && 1 == @$size ) { | |||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
"ARRAY" eq ref $size and 1 == @$size
MC/DC0%0/2
"ARRAY" eq ref $size and 1 == @$size
"ARRAY" eq ref $size
1 == @$size
Truth table0%0/3
A and B
A= "ARRAY" eq ref $sizeB= 1 == @$size
| |||||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | my ($i) = @$size; | |||||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | $regex = qr/^ [0-9]{0,$i} \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 178 | elsif ( 0 == $size ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 179 | 0 | $regex = qr/^ [0-9]+ \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 180 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 181 | elsif ( $size =~ /^[0-9]+\z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | $regex = qr/^ [0-9]{0,$size} \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||
| 186 | 0 | ▶ | $regex ||= qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x; | ||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$regex ||= qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x
MC/DC0%0/1
$regex ||= qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x
$regex
Truth table0%0/2
A
A= $regex
| |||||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||||
| 188 | 0 | map { $_->constraint( { type => 'Regex', regex => $regex } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 189 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||||||||||||||||||
| 191 | 419 | 1; | |||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||
| 193 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||