File: ack-removed-options.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 (34 lines) | stat: -rw-r--r-- 650 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
23
24
25
26
27
28
29
30
31
32
33
34
#!perl -T

use strict;
use warnings;

use Test::More;
use lib 't';
use Util;

prep_environment();

my @options = (qw{
    -a
    --all
    -u
}, ['-G', 'sue']);


plan tests => scalar @options;

foreach my $option (@options) {
    my @args = ref($option) ? @{$option} : ( $option );
    $option  = $option->[0] if ref($option);
    push @args, 'the', 't/text';

    my ( $stdout, $stderr ) = run_ack_with_stderr( @args );

    subtest "options = @args" => sub {
        plan tests => 2;

        is_empty_array( $stdout, 'Nothing in stdout' );
        like( $stderr->[0], qr/Option '$option' is not valid in ack 2/, 'Found error message' );
    };
}