1898184e3Ssthenuse strict; 26fb12b70Safresh1use warnings; 3898184e3Ssthenuse Test::More; 4898184e3Ssthenuse Module::Metadata; 5898184e3Ssthenuse lib "t/lib/0_2"; 6898184e3Ssthen 7898184e3Ssthenplan tests => 4; 8898184e3Ssthen 9898184e3Ssthenrequire Foo; 10*b8851fccSafresh1is($Foo::VERSION, 0.2, 'affirmed version of loaded module'); 11898184e3Ssthen 12898184e3Ssthenmy $meta = Module::Metadata->new_from_module("Foo", inc => [ "t/lib/0_1" ] ); 13*b8851fccSafresh1is($meta->version, 0.1, 'extracted proper version from scanned module'); 14898184e3Ssthen 15*b8851fccSafresh1is($Foo::VERSION, 0.2, 'loaded module still retains its version'); 16898184e3Ssthen 17*b8851fccSafresh1ok(eval "use Foo 0.2; 1", 'successfully loaded module again') 18*b8851fccSafresh1 or diag 'got exception: ', $@; 19898184e3Ssthen 20898184e3Ssthen 21898184e3Ssthen 22898184e3Ssthen 23898184e3Ssthen 24898184e3Ssthen 25