[Module-build-checkins] Module-Build/t moduleinfo.t,1.10,1.11
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <si...@us...> - 2005-10-02 20:00:58
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14772/t Modified Files: moduleinfo.t Log Message: Extend ModuleInfo to recognize full qualified variable name in $VERSION assignments. Index: moduleinfo.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/moduleinfo.t,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- moduleinfo.t 19 Sep 2005 15:13:29 -0000 1.10 +++ moduleinfo.t 2 Oct 2005 02:28:28 -0000 1.11 @@ -3,7 +3,7 @@ use lib 't/lib'; use strict; -use Test::More tests => 50; +use Test::More tests => 58; use File::Spec (); @@ -126,6 +126,20 @@ # whatever } --- + <<'---', # Fully qualified $VERSION declared in package +package Simple; +$Simple::VERSION = 1.23; +--- + <<'---', # Differentiate fully qualified $VERSION in a package +package Simple; +$Simple2::VERSION = '999'; +$Simple::VERSION = 1.23; +--- + <<'---', # Differentiate fully qualified $VERSION and unqualified +package Simple; +$Simple2::VERSION = '999'; +$VERSION = 1.23; +--- <<'---', # $VERSION declared as package variable from within 'main' package $Simple::VERSION = '1.23'; { @@ -147,6 +161,7 @@ my $warnings = ''; local $SIG{__WARN__} = sub { $warnings .= $_ for @_ }; my $pm_info = Module::Build::ModuleInfo->new_from_file( $file ); + is( $pm_info->version, '1.23', "correct module version ($i of $n)" ); is( $warnings, '', 'no warnings from parsing' ); @@ -239,6 +254,16 @@ package main; $VERSION = '0.01'; --- + <<'---', # define 'main' version from other package +package _private; +$::VERSION = 0.01; +$VERSION = '999'; +--- + <<'---', # define 'main' version from other package +package _private; +$VERSION = '999'; +$::VERSION = 0.01; +--- ); ( $i, $n ) = ( 1, scalar( @scripts ) ); |