File Coverage

blib/lib/Sah/Schema/single_line_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::single_line_str;
2              
3 1     1   419871 use strict;
  1         3  
  1         205  
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 = ['str' => {
11             summary => 'A single-line string',
12             description => <<'MARKDOWN',
13              
14             The string can be zero-length, but it cannot contain \x0D or \x0A character.
15              
16             MARKDOWN
17             match => qr/\A(?!.*[\x0A\x0D]).*\z/,
18             examples => [
19             {value=>'', valid=>1},
20             {value=>'a', valid=>1},
21             {value=>"line1\nline2", valid=>0},
22             ],
23             }];
24              
25             1;
26             # ABSTRACT:
27              
28             __END__