1N/A#!./perl -w
1N/A
1N/ABEGIN {
1N/A if ($ENV{PERL_CORE}) {
1N/A @INC = '../lib';
1N/A chdir 't';
1N/A }
1N/A}
1N/A
1N/Ause Getopt::Long qw(:config no_ignore_case);
1N/Adie("Getopt::Long version 2.23_03 required--this is only version ".
1N/A $Getopt::Long::VERSION)
1N/A unless $Getopt::Long::VERSION ge "2.24";
1N/A
1N/Aprint "1..9\n";
1N/A
1N/A@ARGV = qw(-Foo -baR --foo bar);
1N/Aundef $opt_baR;
1N/Aundef $opt_bar;
1N/Aprint "ok 1\n" if GetOptions ("foo", "Foo=s");
1N/Aprint ((defined $opt_foo) ? "" : "not ", "ok 2\n");
1N/Aprint (($opt_foo == 1) ? "" : "not ", "ok 3\n");
1N/Aprint ((defined $opt_Foo) ? "" : "not ", "ok 4\n");
1N/Aprint (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n");
1N/Aprint ((@ARGV == 1) ? "" : "not ", "ok 6\n");
1N/Aprint (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n");
1N/Aprint (!(defined $opt_baR) ? "" : "not ", "ok 8\n");
1N/Aprint (!(defined $opt_bar) ? "" : "not ", "ok 9\n");