Signed-off-by: David Golden <dagolden@cpan.org>
use version;
no strict;
- local $sigil$var;
- \$$var=undef;
\$vsub = sub {
+ local $sigil$var;
+ \$$var=undef;
$line;
\$$var
};
--- /dev/null
+package Foo;
+$Foo::VERSION = '0.1';
+1;
--- /dev/null
+package Foo;
+$Foo::VERSION = '0.2';
+1;
--- /dev/null
+use strict;
+use Test::More;
+use Module::Metadata;
+use lib "t/lib/0.2";
+
+plan tests => 4;
+
+require Foo;
+is $Foo::VERSION, 0.2;
+
+my $meta = Module::Metadata->new_from_module("Foo", inc => [ "t/lib/0.1" ] );
+is $meta->version, 0.1;
+
+is $Foo::VERSION, 0.2;
+
+ok eval "use Foo 0.2; 1";
+
+
+
+
+
+