summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-09-11 20:50:37 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-09-11 20:50:37 +0000
commit8545b19a71bec2bf174ceba51982f52749a4822b (patch)
tree1f5f2a8cc7511639b9210f1d5cdb85bf21ea1b17 /t
parent7481bb52051f557e66a749903d91c3b51ae46e5c (diff)
parent8a7fc0dc3015c8254ce4e866be71508e3379d45d (diff)
downloadperl-8545b19a71bec2bf174ceba51982f52749a4822b.tar.gz
Integrate with Sarathy.
p4raw-id: //depot/cfgperl@4127
Diffstat (limited to 't')
-rwxr-xr-xt/io/openpid.t4
-rwxr-xr-xt/lib/gol-basic.t24
-rwxr-xr-xt/lib/gol-compat.t25
-rwxr-xr-xt/lib/gol-linkage.t37
4 files changed, 90 insertions, 0 deletions
diff --git a/t/io/openpid.t b/t/io/openpid.t
index 21ec0830d4..0e8b934e51 100755
--- a/t/io/openpid.t
+++ b/t/io/openpid.t
@@ -10,6 +10,10 @@
BEGIN {
chdir 't' if -d 't';
unshift @INC, '../lib';
+ if ($^O eq 'dos') {
+ print "1..0 # Skip: no multitasking\n";
+ exit 0;
+ }
}
diff --git a/t/lib/gol-basic.t b/t/lib/gol-basic.t
new file mode 100755
index 0000000000..4b25322336
--- /dev/null
+++ b/t/lib/gol-basic.t
@@ -0,0 +1,24 @@
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @INC, '../lib';
+}
+
+use Getopt::Long 2.17;
+
+print "1..9\n";
+
+@ARGV = qw(-Foo -baR --foo bar);
+Getopt::Long::Configure ("no_ignore_case");
+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");
diff --git a/t/lib/gol-compat.t b/t/lib/gol-compat.t
new file mode 100755
index 0000000000..a4f807c7dd
--- /dev/null
+++ b/t/lib/gol-compat.t
@@ -0,0 +1,25 @@
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @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");
diff --git a/t/lib/gol-linkage.t b/t/lib/gol-linkage.t
new file mode 100755
index 0000000000..a1b2c05be3
--- /dev/null
+++ b/t/lib/gol-linkage.t
@@ -0,0 +1,37 @@
+#!./perl -w
+
+BEGIN {
+ chdir 't' if -d 't';
+ unshift @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");