Codebase list libmodule-metadata-perl / upstream/1.000006
Imported Upstream version 1.000006 gregor herrmann 12 years ago
5 changed file(s) with 49 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
0 1.0.6 2011-08-29 04:00:00
1 - Support PACKAGE BLOCK syntax (VPIT)
2
03 1.0.5 2011-08-02 09:45:00
14 - Localize $package::VERSION during version discovery (MIYAGAWA)
25 - Fix references to Module::Build::ModuleInfo [RT #66133] (DAGOLDEN)
33 "Ken Williams <kwilliams@cpan.org>, Randy W. Sims <RandyS@ThePierianSpring.org>"
44 ],
55 "dynamic_config" : 1,
6 "generated_by" : "ExtUtils::MakeMaker version 6.58, CPAN::Meta::Converter version 2.110930",
6 "generated_by" : "ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150",
77 "license" : [
88 "perl_5"
99 ],
3636 }
3737 },
3838 "release_status" : "stable",
39 "version" : "1.000005"
39 "version" : "1.000006"
4040 }
66 configure_requires:
77 ExtUtils::MakeMaker: 0
88 dynamic_config: 1
9 generated_by: 'ExtUtils::MakeMaker version 6.58, CPAN::Meta::Converter version 2.110930'
9 generated_by: 'ExtUtils::MakeMaker version 6.59, CPAN::Meta::Converter version 2.112150'
1010 license: perl
1111 meta-spec:
1212 url: http://module-build.sourceforge.net/META-spec-v1.4.html
1818 - inc
1919 requires:
2020 version: 0.87
21 version: 1.000005
21 version: 1.000006
1010
1111 use strict;
1212 use vars qw($VERSION);
13 $VERSION = '1.000005';
13 $VERSION = '1.000006';
1414 $VERSION = eval $VERSION;
1515
1616 use File::Spec;
3535 \s* # optional whitespace
3636 ($V_NUM_REGEXP)? # optional version number
3737 \s* # optional whitesapce
38 ; # semicolon line terminator
38 [;\{] # semicolon line terminator or block start (since 5.16)
3939 }x;
4040
4141 my $VARNAME_REGEXP = qr{ # match fully-qualified VERSION name
66 use IO::File;
77 use MBTest;
88
9 my $undef;
10
911 # parse various module $VERSION lines
1012 # these will be reversed later to create %modules
1113 my @modules = (
14 $undef => <<'---', # no $VERSION line
15 package Simple;
16 ---
17 $undef => <<'---', # undefined $VERSION
18 package Simple;
19 our $VERSION;
20 ---
1221 '1.23' => <<'---', # declared & defined on same line with 'our'
1322 package Simple;
1423 our $VERSION = '1.23';
169178 package Simple;
170179 our $VERSION;
171180 $VERSION = 'onetwothree';
181 ---
182 $undef => <<'---', # package NAME BLOCK, undef $VERSION
183 package Simple {
184 our $VERSION;
185 }
186 ---
187 '1.23' => <<'---', # package NAME BLOCK, with $VERSION
188 package Simple {
189 our $VERSION = '1.23';
190 }
191 ---
192 '1.23' => <<'---', # package NAME VERSION BLOCK
193 package Simple 1.23 {
194 1;
195 }
196 ---
197 'v1.2.3_4' => <<'---', # package NAME VERSION BLOCK
198 package Simple v1.2.3_4 {
199 1;
200 }
172201 ---
173202 );
174203 my %modules = reverse @modules;
241270
242271 # Test::Builder will prematurely numify objects, so use this form
243272 my $errs;
244 ok( $pm_info->version eq $expected,
245 "correct module version (expected '$expected')" )
246 or $errs++;
273 my $got = $pm_info->version;
274 if ( defined $expected ) {
275 ok( $got eq $expected,
276 "correct module version (expected '$expected')" )
277 or $errs++;
278 } else {
279 ok( !defined($got),
280 "correct module version (expected undef)" )
281 or $errs++;
282 }
247283 is( $warnings, '', 'no warnings from parsing' ) or $errs++;
248 diag "Got: '@{[$pm_info->version]}'\nModule contents:\n$module" if $errs;
284 diag "Got: '$got'\nModule contents:\n$module" if $errs;
249285 }
250286 }
251287