File: invalid-options.t

package info (click to toggle)
ack 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,636 kB
  • sloc: perl: 10,139; ansic: 21; fortran: 11; makefile: 5; javascript: 3
file content (24 lines) | stat: -rw-r--r-- 605 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
#!perl

# https://github.com/beyondgrep/ack3/issues/192

use strict;
use warnings;

use Test::More tests => 5;
use lib 't';
use Util;

prep_environment();


my ( $stdout, $stderr ) = run_ack_with_stderr( '--bloofga' );
is_empty_array( $stdout, 'No output because of our bad option' );

is( $stderr->[0], 'Unknown option: bloofga', 'First line is the error, and should only appear once' );
like( $stderr->[1], qr/ack(?:-standalone)?: Invalid option on command line/, 'Second line is the general error' );
is( scalar @{$stderr}, 2, 'There are no more lines' );

is( get_rc(), 255, 'Should fail' );

exit 0;