File Coverage

blib/lib/Regexp/Pattern/Filename/Type/Compressed.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::Compressed;
2              
3 1     1   279861 use 5.010001;
  1         4  
4 1     1   5 use strict;
  1         2  
  1         22  
5 1     1   9 use warnings;
  1         2  
  1         60  
6             #use utf8;
7              
8 1     1   588 use Filename::Type::Compressed ();
  1         1170  
  1         173  
9              
10             our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
11             our $DATE = '2024-12-21'; # DATE
12             our $DIST = 'Regexp-Pattern-Filename-Type-Compressed'; # DIST
13             our $VERSION = '0.004'; # VERSION
14              
15             our %RE;
16              
17             my $re = join '|', map {quotemeta} sort keys %Filename::Type::Compressed::SUFFIXES;
18             $re = qr((?:$re)\z)i;
19              
20             $RE{filename_type_compressed} = {
21             summary => 'Compressed data 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.gz', matches=>1},
28             {str=>'foo bar.TAR.BZ2', matches=>1, summary=>'Case insensitive'},
29             {str=>'foo.xz is the file', matches=>0, summary=>'Regex is anchored'},
30             {str=>'foo.mp3', matches=>0},
31             ],
32             };
33              
34             1;
35             # ABSTRACT: Compressed data filename
36              
37             __END__