Scenario/ISBN/Validating.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary ScenarioR/ISBN/Validating.pm »
1 package Bencher::Scenario::ISBN::Validating;
2  
3 1 our $DATE = '2018-08-26'; # DATE
4 1 our $VERSION = '0.001'; # VERSION
5  
6 1 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our $scenario = {
11 summary => 'Benchmark validating ISBN',
12 modules => {
13  
14 },
15 participants => [
16 {
17 module => 'Business::ISBN',
18 code_template => 'Business::ISBN->new(<isbn>)->is_valid ? 1:0',
19 tags => ['isbn10', 'isbn13'],
20 },
21 {
22 module => 'Algorithm::CheckDigits::M10_004',
23 extra_modules => ['Algorithm::CheckDigits'],
24 tags => ['isbn13'],
25 code_template => 'require Algorithm::CheckDigits; Algorithm::CheckDigits::CheckDigits("ean")->is_valid(<isbn>) ? 1:0',
26 },
27 {
28 module => 'Algorithm::CheckDigits::M11_001',
29 extra_modules => ['Algorithm::CheckDigits'],
30 tags => ['isbn10'],
31 code_template => 'require Algorithm::CheckDigits; Algorithm::CheckDigits::CheckDigits("ISBN")->is_valid(<isbn>) ? 1:0',
32 },
33 ],
34 datasets => [
35 {
36 include_participant_tags => ['isbn10'],
37 args => {isbn => '1-56592-257-3'},
38 result => 1,
39 },
40 {
41 include_participant_tags => ['isbn10'],
42 args => {isbn => '1-56592-257-2'},
43 result => 0,
44 },
45  
46 {
47 include_participant_tags => ['isbn13'],
48 args => {isbn => '978-0-596-52724-2'},
49 result => 1,
50 },
51 {
52 include_participant_tags => ['isbn13'],
53 args => {isbn => '978-0-596-52724-1'},
54 result => 0,
55 },
56 ],
57 };
58  
59 1 1;
60 # ABSTRACT: Benchmark validating ISBN
61  
62 __END__
↑ Summary ScenarioR/ISBN/Validating.pm »