File: type.t

package info (click to toggle)
libarchive-any-perl 0.0946-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 464 kB
  • sloc: perl: 566; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 571 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
#!/usr/bin/perl -w

use Test::More tests => 7;
use Test::Warn;

use_ok 'Archive::Any';

isa_ok( Archive::Any->new( 't/naughty.tar', 'tar' ), 'Archive::Any' );

# Recognizes tar files with weird extensions
isa_ok( Archive::Any->new('t/naughty.hominawoof'), 'Archive::Any' );

warning_like {
    ok( !Archive::Any->new( 't/naughty.tar', 'hominawoof' ) );
}
qr{No mime type found for type 'hominawoof'}, "right warning, unknown type";

warning_like {
    ok( !Archive::Any->new('t/garbage.foo') );
}
qr{No handler available for type 'text/plain'}, "right warning, no type";