File Coverage

blib/lib/Sah/Schema/matcher/str.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Sah::Schema::matcher::str;
2              
3 1     1   313389 use strict;
  1         3  
  1         189  
4              
5             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
6             our $DATE = '2024-02-06'; # DATE
7             our $DIST = 'Sah-Schemas-Str'; # DIST
8             our $VERSION = '0.018'; # VERSION
9              
10             our $schema = [any => {
11             summary => 'Something that can be matched against string',
12             description => <<'MARKDOWN',
13              
14             Currently these things are allowed:
15             - another string
16             - regexp (Regexp object)
17             - array of strings
18             - coderef
19              
20             MARKDOWN
21             of => [
22             'str*',
23             'obj::re*',
24             'aos*',
25             'code*',
26             ],
27             examples => [
28             {value=>'foo', valid=>1},
29             {value=>['foo', 'bar', 'baz'], valid=>1},
30             {value=>[qr/foo/], valid=>0, summary=>'Currently only array of strings are allowed'},
31             {value=>qr/foo/, valid=>1},
32             {value=>'foo', valid=>1},
33             {value=>'foo', valid=>1},
34             ],
35              
36             }];
37              
38             1;
39             # ABSTRACT:
40              
41             __END__