Skip Menu |

This queue is for tickets about the Getopt-Long CPAN distribution.

Report information
The Basics
Id: 87581
Status: resolved
Priority: 0/
Queue: Getopt-Long

People
Owner: jv [...] cpan.org
Requestors: jkeenan [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.51
Fixed in: (no value)



Subject: Moving tests of Getopt::Long from Perl 5 lib/Getopt/Std.t
In the Perl 5 core distribution, there are certain unit tests found in lib/Getopt/Std.t which are actually tests for Getopt::Long functionality: ##### # Then try the Getopt::Long module use Getopt::Long; @ARGV = qw(--help --file foo --foo --nobar --num=5 -- file); our ($HELP, $FILE, $FOO, $BAR, $NO); ok( GetOptions( 'help' => \$HELP, 'file:s' => \$FILE, 'foo!' => \$FOO, 'bar!' => \$BAR, 'num:i' => \$NO, ), 'Getopt::Long::GetOptions succeeded' ); is( "@ARGV", 'file', 'options removed from @ARGV (5)' ); ok( $HELP && $FOO && !$BAR && $FILE eq 'foo' && $NO == 5, 'options set' ); ##### Per Dave Mitchell (on p5p, July 12 2013), this is leftover from the days when Getopt::Std and Getopt::Long were jointly tested in a single program. In order to provide for better maintenance of Getopt::Std (perhaps by ultimately moving it to maintenance on CPAN), we would like to remove these tests for Getopt::Long from lib/Getopt/Std.t. I was advised, however, to make sure that this functionality is tested in Getopt::Long's test suite. Accordingly, I have prepared a patch which rewrites those unit tests in the style of Getopt::Long's unit tests and added them to t/gol-basic.t. (I couldn't find any mention of a github or similar site for Getopt::Long's development, so I prepared the patch against 2.41 from CPAN.) Please review. If the additional tests are duplicative, feel free to reject. Otherwise, I hope you can apply it.
Subject: getopt-long-t-gol-basic.diff
18c18 < print "1..9\n"; --- > print "1..12\n"; 31a32,44 > > @ARGV = qw(--help --file foo --foo --nobar --num=5 -- file); > $rv = GetOptions( > 'help' => \$HELP, > 'file:s' => \$FILE, > 'foo!' => \$FOO, > 'bar!' => \$BAR, > 'num:i' => \$NO, > ); > print ($rv ? "" : "not "); print "ok 10\n"; > print ("@ARGV" eq 'file' ? "" : "not ", "ok 11\n"); > ( $HELP && $FOO && !$BAR && $FILE eq 'foo' && $NO == 5 ) > ? print "" : print "not "; print "ok 12\n";
Fixed in 2.52.
Subject: Re: [rt.cpan.org #87581] Moving tests of Getopt::Long from Perl 5 lib/Getopt/Std.t
Date: Tue, 13 Aug 2019 20:57:07 -0400
To: bug-Getopt-Long [...] rt.cpan.org, jkeenan [...] cpan.org
From: James E Keenan <jkeenan [...] pobox.com>
On 8/13/19 1:29 PM, Johan Vromans via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=87581 > > > Fixed in 2.52. >
I don't see 2.52 in https://cpan.metacpan.org/authors/id/J/JV/JV/. Could you be referring to 2.51? Thank you very much. Jim Keenan
The changes are in the github repo. 2.52 will be the next version to be released. Sorry for the confusion...
Subject: Re: [rt.cpan.org #87581] Moving tests of Getopt::Long from Perl 5 lib/Getopt/Std.t
Date: Wed, 14 Aug 2019 07:44:46 -0400
To: bug-Getopt-Long [...] rt.cpan.org
From: James E Keenan <jkeenan [...] pobox.com>
On 8/14/19 3:31 AM, Johan Vromans via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=87581 > > > The changes are in the github repo. > 2.52 will be the next version to be released. > > Sorry for the confusion... >
Thanks. Looking forward to 2.52.