blib/lib/Compress/Stream/Zstd/CompressionDictionary.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 17 | 17 | 100.0 |
branch | 1 | 2 | 50.0 |
condition | 1 | 2 | 50.0 |
subroutine | 5 | 5 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 25 | 27 | 92.5 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Compress::Stream::Zstd::CompressionDictionary; | ||||||
2 | 1 | 1 | 436 | use 5.008001; | |||
1 | 3 | ||||||
3 | 1 | 1 | 4 | use strict; | |||
1 | 3 | ||||||
1 | 34 | ||||||
4 | 1 | 1 | 4 | use warnings; | |||
1 | 2 | ||||||
1 | 37 | ||||||
5 | |||||||
6 | 1 | 1 | 6 | use Compress::Stream::Zstd (); | |||
1 | 3 | ||||||
1 | 116 | ||||||
7 | |||||||
8 | sub new_from_file { | ||||||
9 | 1 | 1 | 1 | 119 | my ($class, $file, $level) = @_; | ||
10 | 1 | 50 | 81 | open my $fh, '<', $file or die $!; | |||
11 | 1 | 8 | local $/; | ||||
12 | 1 | 300 | my $dict = <$fh>; | ||||
13 | 1 | 14 | close $fh; | ||||
14 | 1 | 50 | 1582 | $class->new($dict, $level || 1); | |||
15 | } | ||||||
16 | |||||||
17 | 1; | ||||||
18 | __END__ |