File Coverage

blib/lib/Data/Sah/Type/str.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1              
2             use strict;
3 6     6   2486  
  6         14  
  6         173  
4             use Data::Sah::Util::Role 'has_clause';
5 6     6   1089 use Role::Tiny;
  6         100  
  6         283  
6 6     6   30 use Role::Tiny::With;
  6         10  
  6         31  
7 6     6   732  
  6         15  
  6         997  
8             with 'Data::Sah::Type::BaseType';
9             with 'Data::Sah::Type::Comparable';
10             with 'Data::Sah::Type::Sortable';
11             with 'Data::Sah::Type::HasElems';
12              
13             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
14             our $DATE = '2022-08-20'; # DATE
15             our $DIST = 'Data-Sah'; # DIST
16             our $VERSION = '0.912'; # VERSION
17              
18             # currently we only support regex instead of hash of regexes
19             #my $t_re = 'regex*|{*=>regex*}';
20             my $t_re = ['regex', {req=>1}];
21              
22             has_clause 'encoding',
23             v => 2,
24             tags => ['constraint'],
25             schema => ['str', {req=>1}],
26             allow_expr => 0,
27             ;
28             has_clause 'match',
29             v => 2,
30             tags => ['constraint'],
31             schema => $t_re,
32             allow_expr => 1,
33             ;
34             has_clause 'is_re',
35             v => 2,
36             tags => ['constraint'],
37             schema => ['bool', {}],
38             allow_expr => 1,
39             ;
40              
41             1;
42             # ABSTRACT: str type
43              
44              
45             =pod
46              
47             =encoding UTF-8
48              
49             =head1 NAME
50              
51             Data::Sah::Type::str - str type
52              
53             =head1 VERSION
54              
55             This document describes version 0.912 of Data::Sah::Type::str (from Perl distribution Data-Sah), released on 2022-08-20.
56              
57             =for Pod::Coverage ^(clause_.+|clausemeta_.+)$
58              
59             =head1 HOMEPAGE
60              
61             Please visit the project's homepage at L<https://metacpan.org/release/Data-Sah>.
62              
63             =head1 SOURCE
64              
65             Source repository is at L<https://github.com/perlancar/perl-Data-Sah>.
66              
67             =head1 AUTHOR
68              
69             perlancar <perlancar@cpan.org>
70              
71             =head1 CONTRIBUTING
72              
73              
74             To contribute, you can send patches by email/via RT, or send pull requests on
75             GitHub.
76              
77             Most of the time, you don't need to build the distribution yourself. You can
78             simply modify the code, then test via:
79              
80             % prove -l
81              
82             If you want to build the distribution (e.g. to try to install it locally on your
83             system), you can install L<Dist::Zilla>,
84             L<Dist::Zilla::PluginBundle::Author::PERLANCAR>,
85             L<Pod::Weaver::PluginBundle::Author::PERLANCAR>, and sometimes one or two other
86             Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond
87             that are considered a bug and can be reported to me.
88              
89             =head1 COPYRIGHT AND LICENSE
90              
91             This software is copyright (c) 2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012 by perlancar <perlancar@cpan.org>.
92              
93             This is free software; you can redistribute it and/or modify it under
94             the same terms as the Perl 5 programming language system itself.
95              
96             =head1 BUGS
97              
98             Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Sah>
99              
100             When submitting a bug or request, please include a test-file or a
101             patch to an existing test-file that illustrates the bug or desired
102             feature.
103              
104             =cut