File: 4-all.t

package info (click to toggle)
libfile-libmagic-perl 0.96-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 232 kB
  • sloc: perl: 290; pascal: 88; ansic: 54; makefile: 13
file content (22 lines) | stat: -rw-r--r-- 614 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 strict;
use warnings;
use Test::More tests => 6;

use File::LibMagic qw( :all );

# subs from :easy
is( MagicBuffer("Hello World\n"),   'ASCII text'           );

is( MagicFile('t/samples/foo.txt'), 'ASCII text'           );
is( MagicFile('t/samples/foo.c'  ), 'C source, ASCII text' );

# subs from :complete
my $handle = magic_open(MAGIC_NONE);
magic_load( $handle, q{} );
is( magic_buffer( $handle, "Hello World\n" ), 'ASCII text' );

is( magic_file( $handle, 't/samples/foo.txt' ), 'ASCII text'           );
is( magic_file( $handle, 't/samples/foo.c'   ), 'C source, ASCII text' );

magic_close($handle);