-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path20add-mmagic.t
44 lines (39 loc) · 1.27 KB
/
20add-mmagic.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl -w
use Test::More tests => 2;
use strict;
use SVK::Test;
our $output;
my ($xd, $svk) = build_test();
my ($copath, $corpath) = get_copath();
my ($repospath, undef, $repos) = $xd->find_repos ('//', 1);
$svk->checkout ('//', $copath);
chdir ($copath);
# Create some files with different mime types
create_mime_samples('mime');
# try the File::MMagic MIME detection engine
SKIP: {
eval { require File::MMagic };
skip 'File::MMagic is not installed', 2 if $@;
diag 'File::MMagic version ' . File::MMagic->VERSION;
local $ENV{SVKMIME} = 'File::MMagic';
is_output ($svk, 'add', ['mime'],
[__('A mime'),
__('A mime/empty.txt'),
__('A mime/false.bin'),
__('A mime/foo.bin - (bin)'),
__('A mime/foo.c'),
__('A mime/foo.html'),
__('A mime/foo.jpg - (bin)'),
__('A mime/foo.pl'),
__('A mime/foo.txt'),
__('A mime/not-audio.txt'),
]);
is_output ($svk, 'pl', ['-v', glob("mime/*")],
[__('Properties on mime/foo.bin:'),
' svn:mime-type: application/octet-stream',
__('Properties on mime/foo.html:'),
' svn:mime-type: text/html',
__('Properties on mime/foo.jpg:'),
' svn:mime-type: image/jpeg',
]);
}