
Untitled
By: a guest on
Jul 10th, 2012 | syntax:
None | size: 0.66 KB | hits: 13 | expires: Never
#!/usr/bin/env perl
use strict;
use warnings;
# FILENAME: sub_main_is_not_package.t
# CREATED: 02/07/12 23:07:28 by Kent Fredric (kentnl) <kentfredric@gmail.com>
# ABSTRACT: A weird bug with module::metadata
use Test::More;
use Module::Metadata;
my $data = <<'__EOD__';
use strict;
use warnings;
package Example;
sub main {
return 1;
}
sub other {
return 1;
}
1;
__EOD__
use IO::String;
my $fh = IO::String->new( $data );
my $mm = Module::Metadata->new_from_handle( $fh , 'lib/Example.pm', collect_pod => 0 );
is_deeply( [ sort $mm->packages_inside() ], [ 'Example' ] , 'Should only return \'Example\'') or
note explain $mm;
done_testing;