Git-Database

 view release on metacpan or  search on metacpan

t/lib/TestUtil.pm  view on Meta::CPAN

our @kinds = qw( blob tree commit tag );

# all the following functions will end up in the caller's namespace

# test data
sub objects_from {
    my ($name) = @_;
    my $perl = File::Spec->catfile( 't', 'bundles', "$name.perl" );

    # slurp and eval the content of the file
    my $objects = do { local @ARGV = ($perl); local $/; eval <> }
      or die "Failed processing $perl";

    # add extra information
    for my $kind ( @kinds ) {
        for my $object ( @{ $objects->{$kind} } ) {
            $object->{kind} = $kind;
            $object->{desc} ||= join ' ', $object->{kind}, $object->{digest};
            $object->{sha1} = $object->{digest};
            $object->{size} ||= length $object->{content};
            $object->{string} ||= $object->{content};

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.839 second using v1.00-cache-2.02-grep-82fe00e-cpan-c9a218a2bbc )