Sah/Schema/filename/unix/basename.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 10 / 10 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« Sah/Schema/filename/unix.pm ↑ Summary Sah/Schema/filename/unix/exists.pm »
1 package Sah::Schema::filename::unix::basename;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
6 1 our $DATE = '2024-02-16'; # DATE
7 1 our $DIST = 'Sah-SchemaBundle-Path'; # DIST
8 1 our $VERSION = '0.031'; # VERSION
9  
10 1 our $schema = ["str" => {
11 summary => 'Filesystem base file name on a Unix system',
12 match => '\A(?:[^/\0]{1,255})\z',
13 description => <<'MARKDOWN',
14  
15 This is like the `filename::unix` schema but not allowing directory parts.
16 Difference with `dirname::unix::basename` and `pathname::unix::basename`: the
17 completion rule.
18  
19 MARKDOWN
20 'x.completion' => ['filename_curdir'],
21 prefilters => [
22 ],
23  
24 examples => [
25 {value=>'', valid=>0},
26 {value=>'foo', valid=>1},
27 {value=>'foo/bar', valid=>0, summary=>'Contains directory part'},
28 {value=>'a' x 256, valid=>0, summary=>'Path element too long'},
29 {value=>"foo\0", valid=>0, summary=>"Contains null character"},
30 ],
31  
32 }];
33  
34 1 1;
35 # ABSTRACT: Filesystem base file name on a Unix system
36  
37 __END__
« Sah/Schema/filename/unix.pm ↑ Summary Sah/Schema/filename/unix/exists.pm »