File Coverage

blib/lib/Regexp/Pattern/Filename/Type/Backup.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 15 15 100.0


line stmt bran cond sub pod time code
1             package Regexp::Pattern::Filename::Type::Backup;
2              
3 1     1   356283 use 5.010001;
  1         6  
4 1     1   7 use strict;
  1         2  
  1         33  
5 1     1   5 use warnings;
  1         2  
  1         70  
6             #use utf8;
7              
8 1     1   701 use Filename::Type::Backup ();
  1         899  
  1         240  
9              
10             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11             our $DATE = '2024-12-21'; # DATE
12             our $DIST = 'Regexp-Pattern-Filename-Type-Backup'; # DIST
13             our $VERSION = '0.004'; # VERSION
14              
15             our %RE;
16              
17             my $re = join '|', map {quotemeta} sort keys %Filename::Type::Backup::SUFFIXES;
18             $re = qr((?:$re)\z)i;
19              
20             $RE{filename_type_backup} = {
21             summary => 'Backup filename',
22             pat => $re,
23             tags => ['anchored'],
24             examples => [
25             {str=>'foo', matches=>0, summary=>'No extension'},
26             {str=>'gz', matches=>0, summary=>'Not an extension'},
27             {str=>'foo~', matches=>1},
28             {str=>'foo bar.BAK', matches=>1, summary=>'Case insensitive'},
29             {str=>'foo.old is the file', matches=>0, summary=>'Regex is anchored'},
30             {str=>'foo.txt', matches=>0},
31             ],
32             };
33              
34             1;
35             # ABSTRACT: Backup filename
36              
37             __END__