File: ack-binary.t

package info (click to toggle)
ack-grep 1.96-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,060 kB
  • sloc: perl: 5,822; sh: 162; makefile: 21; ansic: 21; fortran: 11
file content (41 lines) | stat: -rw-r--r-- 745 bytes parent folder | download | duplicates (2)
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
#!perl

use warnings;
use strict;

use Test::More tests => 4;
use App::Ack ();
use File::Next ();

use lib 't';
use Util;

prep_environment();

ACK_F: {
    my @expected = qw(
        t/etc/shebang.empty.xxx
        t/swamp/moose-andy.jpg
        t/swamp/perl.tar.gz
        t/swamp/solution8.tar
    );

    my @files = qw( t );
    my @args = qw( -f --binary );
    my @results = run_ack( @args, @files );

    sets_match( \@results, \@expected, 'Looking for binary' );
}


ACK_BINARY: {
    my @expected = (
        'Binary file t/swamp/moose-andy.jpg matches',
    );

    my @files = qw( t/swamp );
    my @args = qw( -a sRGB );
    my @results = run_ack( @args, @files );

    lists_match( \@results, \@expected, 'Looking for binary' );
}