Change 11588 by jhi@alpha on 2001/08/05 19:40:31
Rename the Getopt::Long tests to be as they are
in the Getopt::Long official distribution.
Affected files ...
... //depot/perl/MANIFEST#515 edit
... //depot/perl/lib/Getopt/Long/t/basic.t#2 delete
... //depot/perl/lib/Getopt/Long/t/compat.t#2 delete
... //depot/perl/lib/Getopt/Long/t/gol-basic.t#1 add
... //depot/perl/lib/Getopt/Long/t/gol-compat.t#1 add
... //depot/perl/lib/Getopt/Long/t/gol-linkage.t#1 add
... //depot/perl/lib/Getopt/Long/t/gol-oo.t#1 add
... //depot/perl/lib/Getopt/Long/t/linkage.t#2 delete
... //depot/perl/lib/Getopt/Long/t/oo.t#2 delete
Differences ...
==== //depot/perl/MANIFEST#515 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST.~1~ Sun Aug 5 13:45:06 2001
+++ perl/MANIFEST Sun Aug 5 13:45:06 2001
@@ -925,10 +925,10 @@
lib/Getopt/Long.pm Fetch command options (GetOptions)
lib/Getopt/Long/CHANGES Getopt::Long changes
lib/Getopt/Long/README Getopt::Long README
-lib/Getopt/Long/t/basic.t See if Getopt::Long works
-lib/Getopt/Long/t/compat.t See if Getopt::Long works
-lib/Getopt/Long/t/linkage.t See if Getopt::Long works
-lib/Getopt/Long/t/oo.t See if Getopt::Long works
+lib/Getopt/Long/t/gol-basic.t See if Getopt::Long works
+lib/Getopt/Long/t/gol-compat.t See if Getopt::Long works
+lib/Getopt/Long/t/gol-linkage.t See if Getopt::Long works
+lib/Getopt/Long/t/gol-oo.t See if Getopt::Long works
lib/Getopt/Std.pm Fetch command options (getopt, getopts)
lib/Getopt/Std.t See if Getopt::Std and Getopt::Long work
lib/getopts.pl Perl library supporting option parsing
==== //depot/perl/lib/Getopt/Long/t/gol-basic.t#1 (text) ====
Index: perl/lib/Getopt/Long/t/gol-basic.t
--- perl/lib/Getopt/Long/t/gol-basic.t.~1~ Sun Aug 5 13:45:06 2001
+++ perl/lib/Getopt/Long/t/gol-basic.t Sun Aug 5 13:45:06 2001
@@ -0,0 +1,26 @@
+#!./perl -w
+
+BEGIN {
+ chdir('t') if -d 't';
+ @INC = '../lib';
+}
+
+use Getopt::Long qw(:config no_ignore_case);
+die("Getopt::Long version 2.24 required--this is only version ".
+ $Getopt::Long::VERSION)
+ unless $Getopt::Long::VERSION >= 2.24;
+
+print "1..9\n";
+
+@ARGV = qw(-Foo -baR --foo bar);
+undef $opt_baR;
+undef $opt_bar;
+print "ok 1\n" if GetOptions ("foo", "Foo=s");
+print ((defined $opt_foo) ? "" : "not ", "ok 2\n");
+print (($opt_foo == 1) ? "" : "not ", "ok 3\n");
+print ((defined $opt_Foo) ? "" : "not ", "ok 4\n");
+print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n");
+print ((@ARGV == 1) ? "" : "not ", "ok 6\n");
+print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n");
+print (!(defined $opt_baR) ? "" : "not ", "ok 8\n");
+print (!(defined $opt_bar) ? "" : "not ", "ok 9\n");
==== //depot/perl/lib/Getopt/Long/t/gol-compat.t#1 (text) ====
Index: perl/lib/Getopt/Long/t/gol-compat.t
--- perl/lib/Getopt/Long/t/gol-compat.t.~1~ Sun Aug 5 13:45:06 2001
+++ perl/lib/Getopt/Long/t/gol-compat.t Sun Aug 5 13:45:06 2001
@@ -0,0 +1,25 @@
+#!./perl -w
+
+BEGIN {
+ chdir('t') if -d 't';
+ @INC = '../lib';
+}
+
+require "newgetopt.pl";
+
+print "1..9\n";
+
+@ARGV = qw(-Foo -baR --foo bar);
+$newgetopt::ignorecase = 0;
+$newgetopt::ignorecase = 0;
+undef $opt_baR;
+undef $opt_bar;
+print "ok 1\n" if NGetOpt ("foo", "Foo=s");
+print ((defined $opt_foo) ? "" : "not ", "ok 2\n");
+print (($opt_foo == 1) ? "" : "not ", "ok 3\n");
+print ((defined $opt_Foo) ? "" : "not ", "ok 4\n");
+print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n");
+print ((@ARGV == 1) ? "" : "not ", "ok 6\n");
+print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n");
+print (!(defined $opt_baR) ? "" : "not ", "ok 8\n");
+print (!(defined $opt_bar) ? "" : "not ", "ok 9\n");
==== //depot/perl/lib/Getopt/Long/t/gol-linkage.t#1 (text) ====
Index: perl/lib/Getopt/Long/t/gol-linkage.t
--- perl/lib/Getopt/Long/t/gol-linkage.t.~1~ Sun Aug 5 13:45:06 2001
+++ perl/lib/Getopt/Long/t/gol-linkage.t Sun Aug 5 13:45:06 2001
@@ -0,0 +1,37 @@
+#!./perl -w
+
+BEGIN {
+ chdir('t') if -d 't';
+ @INC = '../lib';
+}
+
+use Getopt::Long;
+
+print "1..18\n";
+
+@ARGV = qw(-Foo -baR --foo bar);
+Getopt::Long::Configure ("no_ignore_case");
+%lnk = ();
+print "ok 1\n" if GetOptions (\%lnk, "foo", "Foo=s");
+print ((defined $lnk{foo}) ? "" : "not ", "ok 2\n");
+print (($lnk{foo} == 1) ? "" : "not ", "ok 3\n");
+print ((defined $lnk{Foo}) ? "" : "not ", "ok 4\n");
+print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 5\n");
+print ((@ARGV == 1) ? "" : "not ", "ok 6\n");
+print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n");
+print (!(exists $lnk{baR}) ? "" : "not ", "ok 8\n");
+
+@ARGV = qw(-Foo -baR --foo bar);
+Getopt::Long::Configure ("default","no_ignore_case");
+%lnk = ();
+my $foo;
+print "ok 9\n" if GetOptions (\%lnk, "foo" => \$foo, "Foo=s");
+print ((defined $foo) ? "" : "not ", "ok 10\n");
+print (($foo == 1) ? "" : "not ", "ok 11\n");
+print ((defined $lnk{Foo}) ? "" : "not ", "ok 12\n");
+print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 13\n");
+print ((@ARGV == 1) ? "" : "not ", "ok 14\n");
+print (($ARGV[0] eq "bar") ? "" : "not ", "ok 15\n");
+print (!(exists $lnk{foo}) ? "" : "not ", "ok 16\n");
+print (!(exists $lnk{baR}) ? "" : "not ", "ok 17\n");
+print (!(exists $lnk{bar}) ? "" : "not ", "ok 18\n");
==== //depot/perl/lib/Getopt/Long/t/gol-oo.t#1 (text) ====
Index: perl/lib/Getopt/Long/t/gol-oo.t
--- perl/lib/Getopt/Long/t/gol-oo.t.~1~ Sun Aug 5 13:45:06 2001
+++ perl/lib/Getopt/Long/t/gol-oo.t Sun Aug 5 13:45:06 2001
@@ -0,0 +1,26 @@
+#!./perl -w
+
+BEGIN {
+ chdir('t') if -d 't';
+ @INC = '../lib';
+}
+
+use Getopt::Long;
+die("Getopt::Long version 2.24 required--this is only version ".
+ $Getopt::Long::VERSION)
+ unless $Getopt::Long::VERSION >= 2.24;
+print "1..9\n";
+
+@ARGV = qw(-Foo -baR --foo bar);
+my $p = new Getopt::Long::Parser (config => ["no_ignore_case"]);
+undef $opt_baR;
+undef $opt_bar;
+print "ok 1\n" if $p->getoptions ("foo", "Foo=s");
+print ((defined $opt_foo) ? "" : "not ", "ok 2\n");
+print (($opt_foo == 1) ? "" : "not ", "ok 3\n");
+print ((defined $opt_Foo) ? "" : "not ", "ok 4\n");
+print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n");
+print ((@ARGV == 1) ? "" : "not ", "ok 6\n");
+print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n");
+print (!(defined $opt_baR) ? "" : "not ", "ok 8\n");
+print (!(defined $opt_bar) ? "" : "not ", "ok 9\n");
End of Patch.