Upgrade to ExtUtils-MakeMaker-6.35
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / parse_version.t
index 9ddc8a0..78ba52e 100644 (file)
@@ -11,16 +11,35 @@ BEGIN {
 }
 chdir 't';
 
-use Test::More 'no_plan';
+use Test::More;
 use ExtUtils::MakeMaker;
 
-my %versions = ('$VERSION = 0.02'   => 0.02,
+my %versions = (q[$VERSION = '1.00']        => '1.00',
+                q[*VERSION = \'1.01']       => '1.01',
+                q[($VERSION) = q$Revision: 32208 $ =~ /(\d+)/g;] => 32208,
+                q[$FOO::VERSION = '1.10';]  => '1.10',
+                q[*FOO::VERSION = \'1.11';] => '1.11',
+                '$VERSION = 0.02'   => 0.02,
                 '$VERSION = 0.0'    => 0.0,
                 '$VERSION = -1.0'   => -1.0,
                 '$VERSION = undef'  => 'undef',
                 '$wibble  = 1.0'    => 'undef',
+                q[my $VERSION = '1.01']         => 'undef',
+                q[local $VERISON = '1.02']      => 'undef',
+                q[local $FOO::VERSION = '1.30'] => 'undef',
                );
 
+if( eval 'our $foo' ) {
+    $versions{q[our $VERSION = '1.23';]}   = '1.23',
+}
+
+if( eval 'require version; "version"->import' ) {
+    $versions{q[use version; $VERSION = qv(1.2.3);]} = qv(1.2.3);
+    $versions{q[$VERSION = qv(1.2.3)]}               = qv(1.2.3);
+}
+
+plan tests => 2 * keys %versions;
+
 while( my($code, $expect) = each %versions ) {
     open(FILE, ">VERSION.tmp") || die $!;
     print FILE "$code\n";