Sah/Schema/dirname/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/dirname/unix.pm ↑ Summary Sah/Schema/dirname/unix/exists.pm »
1 package Sah::Schema::dirname::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 directory name on a Unix system',
12 description => <<'MARKDOWN',
13  
14 This is like the `dirname::unix` schema but not allowing parent directory parts.
15 Difference with `filename::unix::basename` and `pathname::unix::basename`: the
16 completion rule.
17  
18 MARKDOWN
19 match => '\A(?:[^/\0]{1,255})\z',
20 'x.completion' => ['dirname_curdir'],
21 prefilters => [
22 ],
23  
24 examples => [
25 {value=>'', valid=>0},
26 {value=>'/', valid=>0, summary=>"Contains path"},
27 {value=>'foo/bar', valid=>0, summary=>'Contains parent 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 directory name on a Unix system
36  
37 __END__
« Sah/Schema/dirname/unix.pm ↑ Summary Sah/Schema/dirname/unix/exists.pm »