summaryrefslogtreecommitdiff
path: root/cpan/dist/File-MMagic/t/06-conthook.t
blob: a7c3cdd7c57b01928121cb9e10afa23b7166da7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# perl-test
# $Id$

use strict;
use Test;

BEGIN { plan tests => 1 };

use File::MMagic;

my $ans = "text/plain; conthook";
my $magic = File::MMagic->new();
$magic->addContainerHook($ans, sub {
	my $self = shift;
	my $data = shift;
	return "text/plain; conthook" if $data =~ /conthook/;
	return ""; });
my $ret = $magic->checktype_container('text conthook');
ok($ret eq $ans);