Update to Getopt::Long 2.24, from Johan Vromans.
[p5sagit/p5-mst-13.2.git] / t / lib / gol-oo.t
1 #!./perl -w
2
3 BEGIN {
4     chdir('t') if -d 't';
5     @INC = '../lib';
6 }
7
8 use Getopt::Long;
9 die("Getopt::Long version 2.24 required--this is only version ".
10     $Getopt::Long::VERSION)
11   unless $Getopt::Long::VERSION >= 2.24;
12 print "1..9\n";
13
14 @ARGV = qw(-Foo -baR --foo bar);
15 my $p = new Getopt::Long::Parser (config => ["no_ignore_case"]);
16 undef $opt_baR;
17 undef $opt_bar;
18 print "ok 1\n" if $p->getoptions ("foo", "Foo=s");
19 print ((defined $opt_foo)   ? "" : "not ", "ok 2\n");
20 print (($opt_foo == 1)      ? "" : "not ", "ok 3\n");
21 print ((defined $opt_Foo)   ? "" : "not ", "ok 4\n");
22 print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n");
23 print ((@ARGV == 1)         ? "" : "not ", "ok 6\n");
24 print (($ARGV[0] eq "bar")  ? "" : "not ", "ok 7\n");
25 print (!(defined $opt_baR)  ? "" : "not ", "ok 8\n");
26 print (!(defined $opt_bar)  ? "" : "not ", "ok 9\n");