develooper Front page | perl.perl5.porters | Postings from July 2013

lib/Getopt/Std.t: Why does it include tests for Getopt::Long?

Thread Next
James E Keenan
July 12, 2013 16:02
lib/Getopt/Std.t: Why does it include tests for Getopt::Long?
Message ID:
Getopt::Std is maintained by Perl 5 Porters; in Porting/, 
"upstream" is "blead".

Getopt::Long is maintained on CPAN by Johan Vromans; "upstream" is "cpan".

I would therefore expect *not* to find tests for Getopt::Long inside a 
file whose objective is testing Getopt::Std.  However, lib/Getopt/Std.t 
does, in fact, have a 3-unit-test section devoted to testing Getopt::Long.

  55 # Then try the Getopt::Long module
  57 use Getopt::Long;
  59 @ARGV = qw(--help --file foo --foo --nobar --num=5 -- file);
  61 our ($HELP, $FILE, $FOO, $BAR, $NO);
  63 ok( GetOptions(
  64     'help'   => \$HELP,
  65     'file:s' => \$FILE,
  66     'foo!'   => \$FOO,
  67     'bar!'   => \$BAR,
  68     'num:i'  => \$NO,
  69     ),
  70     'Getopt::Long::GetOptions succeeded'
  71 );
  72 is( "@ARGV", 'file', 'options removed from @ARGV (5)' );
  73 ok( $HELP && $FOO && !$BAR && $FILE eq 'foo' && $NO == 5, 'options 
set' );

Assuming that this part of Getopt::Long's functionality is tested in its 
own test suite, can we/should we remove this part of lib/Getopt/Std.t?

Modest benefit:  enabling us to see more clearly what part of 
lib/Getopt/'s code is covered by lib/Getopt/Std.t.

Thank you very much.
Jim Keenan

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About