File Coverage

blib/lib/Sah/Schema/obj/re.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::obj::re;
2              
3 1     1   371552 use strict;
  1         2  
  1         195  
4              
5             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
6             our $DATE = '2023-12-20'; # DATE
7             our $DIST = 'Sah-Schemas-Re'; # DIST
8             our $VERSION = '0.006'; # VERSION
9              
10             our $schema = [
11             obj => {
12             summary => 'Regexp object',
13             description => <<'MARKDOWN',
14              
15             This schema can be used as a stricter version of the `re` type. Unlike `re`,
16             this schema only accepts `Regexp` object and not string.
17              
18             MARKDOWN
19              
20             isa => 'Regexp',
21              
22             examples => [
23             {value=>qr//, valid=>1},
24             {value=>qr(^abc$)i, valid=>1},
25             {value=>'^abc$', valid=>0, summary=>'Not a Regexp object'},
26             ],
27             },
28             ];
29              
30             1;
31             # ABSTRACT: Regexp object
32              
33             __END__