Upgrade to Getopt::Long 2.32_05
[p5sagit/p5-mst-13.2.git] / lib / Getopt / Long / t / gol-linkage.t
CommitLineData
1a505819 1#!./perl -w
2
36e6c0f5 3BEGIN {
10933be5 4 if ($ENV{PERL_CORE}) {
5 @INC = '../lib';
6 chdir 't';
7 }
36e6c0f5 8}
9
1a505819 10use Getopt::Long;
11
12print "1..18\n";
13
14@ARGV = qw(-Foo -baR --foo bar);
15Getopt::Long::Configure ("no_ignore_case");
16%lnk = ();
17print "ok 1\n" if GetOptions (\%lnk, "foo", "Foo=s");
18print ((defined $lnk{foo}) ? "" : "not ", "ok 2\n");
19print (($lnk{foo} == 1) ? "" : "not ", "ok 3\n");
20print ((defined $lnk{Foo}) ? "" : "not ", "ok 4\n");
21print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 5\n");
22print ((@ARGV == 1) ? "" : "not ", "ok 6\n");
23print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n");
24print (!(exists $lnk{baR}) ? "" : "not ", "ok 8\n");
25
26@ARGV = qw(-Foo -baR --foo bar);
27Getopt::Long::Configure ("default","no_ignore_case");
28%lnk = ();
29my $foo;
30print "ok 9\n" if GetOptions (\%lnk, "foo" => \$foo, "Foo=s");
31print ((defined $foo) ? "" : "not ", "ok 10\n");
32print (($foo == 1) ? "" : "not ", "ok 11\n");
33print ((defined $lnk{Foo}) ? "" : "not ", "ok 12\n");
34print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 13\n");
35print ((@ARGV == 1) ? "" : "not ", "ok 14\n");
36print (($ARGV[0] eq "bar") ? "" : "not ", "ok 15\n");
37print (!(exists $lnk{foo}) ? "" : "not ", "ok 16\n");
38print (!(exists $lnk{baR}) ? "" : "not ", "ok 17\n");
39print (!(exists $lnk{bar}) ? "" : "not ", "ok 18\n");