File Coverage

blib/lib/Data/Sah/Compiler/human/TH/Comparable.pm
Criterion Covered Total %
statement 23 23 100.0
branch 3 4 75.0
condition n/a
subroutine 7 7 100.0
pod 0 1 0.0
total 33 35 94.2


line stmt bran cond sub pod time code
1              
2             use 5.010;
3 21     21   8974 use strict;
  21         64  
4 21     21   96 use warnings;
  21         34  
  21         357  
5 21     21   80 #use Log::Any '$log';
  21         36  
  21         580  
6              
7             use Mo qw(build default);
8 21     21   214 use Role::Tiny;
  21         40  
  21         139  
9 21     21   4969 use Role::Tiny::With;
  21         41  
  21         97  
10 21     21   3079  
  21         46  
  21         3989  
11             with 'Data::Sah::Type::Comparable';
12              
13             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
14             our $DATE = '2022-09-30'; # DATE
15             our $DIST = 'Data-Sah'; # DIST
16             our $VERSION = '0.913'; # VERSION
17              
18             my ($self, $which, $cd) = @_;
19             my $c = $self->compiler;
20 1753     1753 0 3383  
21 1753         5138 my $fmt;
22             if ($which eq 'is') {
23 1753         7405 $c->add_ccl($cd, {expr=>1, multi=>1,
24 1753 100       4536 fmt => '%(modal_verb)s have the value %s'});
    50          
25 909         4151 } elsif ($which eq 'in') {
26             $c->add_ccl($cd, {expr=>1, multi=>1,
27             fmt => '%(modal_verb)s be one of %s'});
28 844         3692 }
29             }
30             1;
31             # ABSTRACT: human's type handler for role "Comparable"
32              
33              
34             =pod
35              
36             =encoding UTF-8
37              
38             =head1 NAME
39              
40             Data::Sah::Compiler::human::TH::Comparable - human's type handler for role "Comparable"
41              
42             =head1 VERSION
43              
44             This document describes version 0.913 of Data::Sah::Compiler::human::TH::Comparable (from Perl distribution Data-Sah), released on 2022-09-30.
45              
46             =for Pod::Coverage ^(clause_.+|superclause_.+)$
47              
48             =head1 HOMEPAGE
49              
50             Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah>.
51              
52             =head1 SOURCE
53              
54             Source repository is at L<https://github.com/perlancar/perl-Data-Sah>.
55              
56             =head1 AUTHOR
57              
58             perlancar <perlancar@cpan.org>
59              
60             =head1 CONTRIBUTING
61              
62              
63             To contribute, you can send patches by email/via RT, or send pull requests on
64             GitHub.
65              
66             Most of the time, you don't need to build the distribution yourself. You can
67             simply modify the code, then test via:
68              
69             % prove -l
70              
71             If you want to build the distribution (e.g. to try to install it locally on your
72             system), you can install L<Dist::Zilla>,
73             L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
74             L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
75             Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
76             that are considered a bug and can be reported to me.
77              
78             =head1 COPYRIGHT AND LICENSE
79              
80             This software is copyright (c) 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012 by perlancar <perlancar@cpan.org>.
81              
82             This is free software; you can redistribute it and/or modify it under
83             the same terms as the Perl 5 programming language system itself.
84              
85             =head1 BUGS
86              
87             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah>
88              
89             When submitting a bug or request, please include a test-file or a
90             patch to an existing test-file that illustrates the bug or desired
91             feature.
92              
93             =cut