| 1 | package Data::Sah::Value::perl::Str::repeat; | ||||||||||||
| 2 | |||||||||||||
| 3 | 2 | ▶ | use 5.010001; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | |||||||||||||
| 7 | 2 | ▶ | use Data::Dmp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 2 | our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY | |||||||||||
| 10 | 2 | our $DATE = '2024-01-17'; # DATE | |||||||||||
| 11 | 2 | our $DIST = 'Data-Sah-DefaultValue'; # DIST | |||||||||||
| 12 | 2 | our $VERSION = '0.005'; # VERSION | |||||||||||
| 13 | |||||||||||||
| 14 | 2 | ▶ | sub meta { | ||||||||||
|
Subroutine
meta: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 15 | +{ | ||||||||||||
| 16 | 2 | v => 1, | |||||||||||
| 17 | summary => 'Repeat a string a number of times', | ||||||||||||
| 18 | prio => 50, | ||||||||||||
| 19 | args => { | ||||||||||||
| 20 | str => {schema=>'str*', req=>1}, | ||||||||||||
| 21 | n => {schema=>'uint*', default=>1}, | ||||||||||||
| 22 | }, | ||||||||||||
| 23 | }; | ||||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 2 | ▶ | sub value { | ||||||||||
|
Subroutine
value: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||||
| 27 | 2 | my %cargs = @_; | |||||||||||
| 28 | |||||||||||||
| 29 | 2 | ▶ | my $gen_args = $cargs{args} // {}; | ||||||||||
|
Condition50%1/2
$cargs{"args"} // {}
MC/DC0%0/1
$cargs{"args"} // {}
$cargs{"args"}
Truth table50%1/2
A
A= $cargs{"args"}
| |||||||||||||
| 30 | 2 | my $res = {}; | |||||||||||
| 31 | |||||||||||||
| 32 | 2 | ▶ | $res->{expr_value} = dmp($gen_args->{str}) . " x " . ($gen_args->{n}//1); | ||||||||||
|
Condition50%1/2
$gen_args->{"n"} // 1
MC/DC0%0/1
$gen_args->{"n"} // 1
$gen_args->{"n"}
Truth table50%1/2
A
A= $gen_args->{"n"}
| |||||||||||||
| 33 | |||||||||||||
| 34 | 2 | $res; | |||||||||||
| 35 | } | ||||||||||||
| 36 | |||||||||||||
| 37 | 2 | 1; | |||||||||||
| 38 | # ABSTRACT: | ||||||||||||
| 39 | |||||||||||||
| 40 | __END__ | ||||||||||||