Sah/Schema/perl/identifier/qualified_ascii.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 100% 14 / 14 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Sah/Schema/perl/funcname.pm ↑ Summary Sah/Schema/perl/identifier/qualified_unicode.pm »
1 package Sah::Schema::perl::identifier::qualified_ascii;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
7 1 our $DATE = '2024-02-16'; # DATE
8 1 our $DIST = 'Sah-SchemaBundle-Perl'; # DIST
9 1 our $VERSION = '0.050'; # VERSION
10  
11 1 our $schema = [str => {
12 summary => 'Qualified identifier in Perl, without "use utf8" in effect',
13 description => <<'_',
14  
15 _
16 match => qr/\A[A-Za-z_][A-Za-z_0-9]*(?:::[A-Za-z_0-9]+)+\z/,
17 max_len => 251, # total max length, with qualifier and all the '::', but without the sigil
18  
19 examples => [
20 {value=>'', valid=>0, summary=>'Empty'},
21  
22 # ascii
23 {value=>'foo', valid=>0, summary=>'Not qualified'},
24 {value=>'foo::bar', valid=>1},
25 {value=>"foo'bar", valid=>0, summary=>"This schema does not accept the old (soon-to-be-deprecated) namespace separator"},
26 {value=>'_foo::bar', valid=>1},
27 {value=>'0foo::bar', valid=>0, summary=>'Cannot start with a digit'},
28 {value=>'foo::0', valid=>1, summary=>'Secondary+ parts are allowed to start with a digit (1)'},
29 {value=>'foo::0bar', valid=>1, summary=>'Secondary+ parts are allowed to start with a digit (2)'},
30 {value=>'foo0::bar', valid=>1},
31 {value=>'foo::bar-baz', valid=>0, summary=>'Invalid character (dash)'},
32 {value=>'$foo::bar', valid=>0, summary=>'Sigil not accepted'},
33  
34 # unicode
35 {value=>'foo::bébé', valid=>0, summary=>'Non-latin letter not accepted'},
36 ],
37  
38 }];
39  
40 1 1;
41 # ABSTRACT: Qualified identifier in Perl, without "use utf8" in effect
42  
43 __END__
« Sah/Schema/perl/funcname.pm ↑ Summary Sah/Schema/perl/identifier/qualified_unicode.pm »