1#!./perl -w 2 3no strict; 4 5BEGIN { 6 if ($ENV{PERL_CORE}) { 7 @INC = '../lib'; 8 chdir 't'; 9 } 10} 11 12require "newgetopt.pl"; 13 14print "1..9\n"; 15 16@ARGV = qw(-Foo -baR --foo bar); 17$newgetopt::ignorecase = 0; 18$newgetopt::ignorecase = 0; 19undef $opt_baR; 20undef $opt_bar; 21print "ok 1\n" if NGetOpt ("foo", "Foo=s"); 22print ((defined $opt_foo) ? "" : "not ", "ok 2\n"); 23print (($opt_foo == 1) ? "" : "not ", "ok 3\n"); 24print ((defined $opt_Foo) ? "" : "not ", "ok 4\n"); 25print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n"); 26print ((@ARGV == 1) ? "" : "not ", "ok 6\n"); 27print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n"); 28print (!(defined $opt_baR) ? "" : "not ", "ok 8\n"); 29print (!(defined $opt_bar) ? "" : "not ", "ok 9\n"); 30