This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
integrate vmsperl contents into mainline
[perl5.git] / t / lib / gol-linkage.t
CommitLineData
1a505819
GS
1#!./perl -w
2
3BEGIN {
4 chdir 't' if -d 't';
5 unshift @INC, '../lib';
6}
7
8use Getopt::Long;
9
10print "1..18\n";
11
12@ARGV = qw(-Foo -baR --foo bar);
13Getopt::Long::Configure ("no_ignore_case");
14%lnk = ();
15print "ok 1\n" if GetOptions (\%lnk, "foo", "Foo=s");
16print ((defined $lnk{foo}) ? "" : "not ", "ok 2\n");
17print (($lnk{foo} == 1) ? "" : "not ", "ok 3\n");
18print ((defined $lnk{Foo}) ? "" : "not ", "ok 4\n");
19print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 5\n");
20print ((@ARGV == 1) ? "" : "not ", "ok 6\n");
21print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n");
22print (!(exists $lnk{baR}) ? "" : "not ", "ok 8\n");
23
24@ARGV = qw(-Foo -baR --foo bar);
25Getopt::Long::Configure ("default","no_ignore_case");
26%lnk = ();
27my $foo;
28print "ok 9\n" if GetOptions (\%lnk, "foo" => \$foo, "Foo=s");
29print ((defined $foo) ? "" : "not ", "ok 10\n");
30print (($foo == 1) ? "" : "not ", "ok 11\n");
31print ((defined $lnk{Foo}) ? "" : "not ", "ok 12\n");
32print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 13\n");
33print ((@ARGV == 1) ? "" : "not ", "ok 14\n");
34print (($ARGV[0] eq "bar") ? "" : "not ", "ok 15\n");
35print (!(exists $lnk{foo}) ? "" : "not ", "ok 16\n");
36print (!(exists $lnk{baR}) ? "" : "not ", "ok 17\n");
37print (!(exists $lnk{bar}) ? "" : "not ", "ok 18\n");