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 44 45 46 47 48 49 50 51 52 53 54 55
|
#!perl -w
use warnings;
use strict;
use Test::More tests => 3;
use File::Next 0.22;
use lib 't';
use Util;
prep_environment();
BEGIN {
use_ok( 'App::Ack' );
}
# NOTE! This block does a chdir. If you add more tests after it, you
# may be sorry.
my $swamp = 't/swamp';
chdir $swamp or die "Unable to chdir to $swamp: $!\n";
my @actual_swamp_perl = qw(
0
Makefile.PL
options.pl
perl.cgi
perl.pl
perl.pm
perl.pod
perl-test.t
perl-without-extension
);
HANDLE_ZEROES: {
my $iter =
File::Next::files( {
file_filter => sub { return is_filetype( $File::Next::name, 'perl' ) }, ## no critic
descend_filter => \&App::Ack::ignoredir_filter,
}, '.' );
my @files = slurp( $iter );
sets_match( \@files, \@actual_swamp_perl, 'HANDLE_ZEROES' );
}
DASH_F: {
my @args = qw( -f --perl );
my $cmd = "$^X -T ../../ack-standalone @args";
my @results = `$cmd`;
chomp @results;
sets_match( \@results, \@actual_swamp_perl, 'DASH_F' );
}
|