File: ack-create-ackrc.t

package info (click to toggle)
ack 2.24-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,704 kB
  • sloc: perl: 8,590; ansic: 21; fortran: 11; makefile: 5; sh: 5
file content (28 lines) | stat: -rw-r--r-- 830 bytes parent folder | download | duplicates (3)
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
#!perl -T

use strict;
use warnings;

use lib 't';

use Test::More tests => 5;
use Util;
use App::Ack ();
use App::Ack::ConfigDefault ();

prep_environment();

my @commented   = App::Ack::ConfigDefault::options();
my @uncommented = App::Ack::ConfigDefault::options_clean();

cmp_ok( scalar @commented, '>', scalar @uncommented, 'There are fewer lines in the uncommented options.' );

my @output      = run_ack( 'ack', '--create-ackrc' );

ok(scalar(grep { $_ eq '--ignore-ack-defaults' } @output), '--ignore-ack-defaults should be present in output');
@output = grep { $_ ne '--ignore-ack-defaults' } @output;

lists_match(\@output, \@commented, 'lines in output should match the default options');

my @versions = grep { /\Qack version $App::Ack::VERSION/ } @commented;
is( scalar @versions, 1, 'Got exactly one version line' );