File: unpack_notextractable.t

package info (click to toggle)
libmodule-cpants-analyse-perl 0.85%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 340 kB
  • ctags: 86
  • sloc: perl: 1,682; sh: 48; makefile: 10
file content (22 lines) | stat: -rw-r--r-- 583 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use Test::More tests => 3;
use Test::Warn;

use Module::CPANTS::Analyse;
use File::Spec::Functions;

my $a=Module::CPANTS::Analyse->new({
    dist=>'t/eg/not_extractable.gz',
    _dont_cleanup=>$ENV{DONT_CLEANUP},
});

my $rv;
warnings_are {$rv=$a->unpack} [
            'Invalid header block at offset unknown',
            'Invalid header block at offset unknown',
            'No data could be read from file',
            ]
            , 'unpack warns';

like($rv,qr/Can.t call method .extract./,'unpack failed');
is($a->d->{extractable},0,'extractable');