dslinux/user/perl/lib/Getopt/Long/t gol-basic.t gol-compat.t gol-linkage.t gol-oo.t
cayenne
dslinux_cayenne at user.in-berlin.de
Mon Dec 4 18:00:44 CET 2006
Update of /cvsroot/dslinux/dslinux/user/perl/lib/Getopt/Long/t
In directory antilope:/tmp/cvs-serv17422/lib/Getopt/Long/t
Added Files:
gol-basic.t gol-compat.t gol-linkage.t gol-oo.t
Log Message:
Adding fresh perl source to HEAD to branch from
--- NEW FILE: gol-compat.t ---
#!./perl -w
no strict;
BEGIN {
if ($ENV{PERL_CORE}) {
@INC = '../lib';
chdir 't';
}
}
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");
--- NEW FILE: gol-basic.t ---
#!./perl -w
no strict;
BEGIN {
if ($ENV{PERL_CORE}) {
@INC = '../lib';
chdir 't';
}
}
use Getopt::Long qw(:config no_ignore_case);
my $want_version="2.24";
die("Getopt::Long version $want_version required--this is only version ".
$Getopt::Long::VERSION)
unless $Getopt::Long::VERSION ge $want_version;
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");
--- NEW FILE: gol-linkage.t ---
#!./perl -w
no strict;
BEGIN {
if ($ENV{PERL_CORE}) {
@INC = '../lib';
chdir 't';
}
}
use Getopt::Long;
print "1..32\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");
@ARGV = qw(/Foo=-baR --bar bar);
Getopt::Long::Configure ("default","prefix_pattern=--|/|-|\\+","long_prefix_pattern=--|/");
%lnk = ();
my $bar;
print "ok 19\n" if GetOptions (\%lnk, "bar" => \$bar, "Foo=s");
print ((defined $bar) ? "" : "not ", "ok 20\n");
print (($bar == 1) ? "" : "not ", "ok 21\n");
print ((defined $lnk{Foo}) ? "" : "not ", "ok 22\n");
print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 23\n");
print ((@ARGV == 1) ? "" : "not ", "ok 24\n");
print (($ARGV[0] eq "bar") ? "" : "not ", "ok 25\n");
print (!(exists $lnk{foo}) ? "" : "not ", "ok 26\n");
print (!(exists $lnk{baR}) ? "" : "not ", "ok 27\n");
print (!(exists $lnk{bar}) ? "" : "not ", "ok 28\n");
{
my $errors;
%lnk = ();
local $SIG{__WARN__}= sub { $errors.=join("\n", at _,'') };
@ARGV = qw(/Foo=-baR);
Getopt::Long::Configure ("default","bundling","ignore_case_always",
"prefix_pattern=--|/|-|\\+","long_prefix_pattern=--");
%lnk = ();
undef $bar;
GetOptions (\%lnk, "bar" => \$bar, "Foo=s");
print (($errors=~/Unknown option:/) ? "" : "not ", "ok 29\n");
$errors="";
%lnk = ();
undef $bar;
@ARGV = qw(/Foo=-baR);
Getopt::Long::Configure ("default","bundling","ignore_case_always",
"prefix_pattern=--|/|-|\\+","long_prefix_pattern=--|/");
GetOptions (\%lnk, "bar" => \$bar, "Foo=s");
print (($errors eq '') ? "" : "not ", "ok 30\n");
print ((defined $lnk{Foo}) ? "" : "not ", "ok 31\n");
print (($lnk{Foo} eq "-baR") ? "" : "not ", "ok 32\n");
}
--- NEW FILE: gol-oo.t ---
#!./perl -w
no strict;
BEGIN {
if ($ENV{PERL_CORE}) {
@INC = '../lib';
chdir 't';
}
}
use Getopt::Long;
my $want_version="2.24";
die("Getopt::Long version $want_version required--this is only version ".
$Getopt::Long::VERSION)
unless $Getopt::Long::VERSION ge $want_version;
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");
More information about the dslinux-commit
mailing list