File: fail_quoted_args.t

package info (click to toggle)
libgetopt-euclid-perl 0.4.5-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 692 kB
  • ctags: 188
  • sloc: perl: 2,410; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 601 bytes parent folder | download | duplicates (6)
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
use Test::More 'no_plan';

BEGIN {
    require 5.006_001 or plan 'skip_all';
    close *STDERR;
    open *STDERR, '>', \my $stderr;
    *CORE::GLOBAL::exit = sub { die $stderr };
}

BEGIN {
    @ARGV = (
        '-foo bar',
    );
    # This is equivalent to running:
    #    quoted_args_3.t '-foo bar'
    # or:
    #    quoted_args_2.t -foo\ bar
}


if (eval { require Getopt::Euclid and Getopt::Euclid->import(); 1 }) {
    ok 0 => 'Unexpectedly succeeded';
}
else {
    like $@, qr/Unknown argument/   => 'Failed as expected'; 
}


=head1 REQUIRED ARGUMENTS

=over

=item -foo <foo>

=back

=cut