lib/App/FuguBench/Version.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 10 / 10 Podpod 100% 2 / 2 totaltotal 90.9% 40 / 44 CC 3 SCAR 5.0
CC
3
Cov
93%
line
3.6
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« lib/App/FuguBench.pm ↑ Summary bin/fugubench »
1 # ex:ts=8 sw=4:
2 # $OpenBSD$
3 #
4 # Copyright (c) 2026 Dick Olsson <hi@senzilla.io>
5 #
6 # Permission to use, copy, modify, and distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
9 #
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17  
18 package App::FuguBench::Version;
19 117 our $VERSION = '0.1.1';
20  
21 117 ▶use v5.34;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 117 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 117 ▶use experimental 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
24 117 ▶no feature qw(indirect multidimensional bareword_filehandles);
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 117 ▶use Fugu;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 117 ▶use Fugu::CLI qw(EXIT_SUCCESS);
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 # App::FuguBench::Version - the version verb.
30 #
31 # The dist build stamps our $VERSION into every staged package, so a
32 # checkout carries no stamp and reports 0.0.0. The Fugu version is
33 # the version of the loaded library: the installed one in a checkout,
34 # and the snapshot in the pack.
35  
36 117 ▶use constant NO_STAMP => '0.0.0';
Subroutine BEGIN: called CC=1 SCAR=0.0
37  
38 # App::FuguBench::Version->command($verb):
39 # The entry of the Fugu::CLI table. The module holds one verb,
40 # so it ignores the name.
41 117 ▶sub command ( $, $ )
Subroutine command: called CC=1 SCAR=0.0
Pod documented
42 {
43 return {
44 summary => 'print the version',
45 5 ▶ run => sub ( $, @ ) {
Subroutine __ANON__: called CC=1 SCAR=0.0
46 5 say __PACKAGE__->line;
47  
48 5 return EXIT_SUCCESS;
49 },
50 117 };
51 }
52  
53 # App::FuguBench::Version->line:
54 # The line of the verb: the version of the program and the
55 # version of the Fugu library beside it.
56 #
57 # The doctor reports this line as its version check, so the two
58 # verbs never name a different version.
59 5 ▶sub line ($)
Subroutine line: called CC=3 SCAR=12.7
Pod documented
60 {
61 5 ▶ return sprintf 'fugubench %s (Fugu %s)',
Condition50%2/4
"App::FuguBench"->VERSION // "0.0.0"
l!l
50
"Fugu"->VERSION // "0.0.0"
l!l
50
MC/DC0%0/1
"App::FuguBench"->VERSION // "0.0.0"
"App::FuguBench"->VERSION
MC/DC0%0/1
"Fugu"->VERSION // "0.0.0"
"Fugu"->VERSION
Truth table50%1/2
A
A= "App::FuguBench"->VERSION
Aresult
11
00
Truth table50%1/2
A
A= "Fugu"->VERSION
Aresult
11
00
62 App::FuguBench->VERSION // NO_STAMP,
63 Fugu->VERSION // NO_STAMP;
64 }
65  
66 117 1;
« lib/App/FuguBench.pm ↑ Summary bin/fugubench »