use strict;
use lib $ENV{PERL_CORE} ? '../lib/Module/Build/t/lib' : 't/lib';
-use MBTest tests => 46;
+use MBTest tests => 47;
use Cwd ();
my $cwd = Cwd::cwd;
'Foo::Bar' => { file => 'lib/Simple.pm',
version => '1.23' }});
+{
+ $dist->change_file( 'lib/Simple.pm', <<'---' );
+package Simple;
+$VERSION = version->new('0.60.' . (qw$Revision: 128 $)[1]);
+package Simple::Simon;
+$VERSION = version->new('0.61.' . (qw$Revision: 129 $)[1]);
+---
+ $dist->regen;
+ my $provides = new_build()->prepare_metadata()->{provides};
+ is $provides->{'Simple'}{version}, '0.60.128', "Check version";
+ is $provides->{'Simple::Simon'}{version}, '0.61.129', "Check version";
+ is ref($provides->{'Simple'}{version}), '', "Versions from prepare_metadata() aren't refs";
+ is ref($provides->{'Simple::Simon'}{version}), '', "Versions from prepare_metadata() aren't refs";
+}
+
# Single file with multiple differing packages, no corresponding package
# Simple.pm => Foo
$mb = new_build();
is_deeply($mb->find_dist_packages, {});
-
-{
- # Put our YAML escaper through a few tests. This isn't part of the M::B API.
- my $yq = sub {Module::Build->_yaml_quote_string(@_)};
- like $yq->(''), qr{^ (['"]) \1 $}x;
- is $yq->('Foo "bar" baz'), q{'Foo "bar" baz'};
- is $yq->("Foo 'bar' baz"), q{"Foo 'bar' baz"};
-}
-
############################################################
# cleanup
chdir( $cwd ) or die "Can't chdir to '$cwd': $!";