Archive-Ar-Libarchive
view release on metacpan or search on metacpan
{
my $ar = Archive::Ar::Libarchive->new;
$ar->add_data("foo.txt", "foo content", {
uid => 101,
gid => 202,
date => 12345679,
mode => 0100640,
});
$ar->add_data("bar.txt", "bar content\nbar content\n", {
uid => 303,
gid => 404,
date => 123456798,
mode => 0100600,
});
$ar;
}
sub check_content
{
my $ar = shift;
subtest 'content' => sub {
plan tests => 3;
is_deeply scalar $ar->list_files, [qw( foo.txt bar.txt )], 'contains files foo and bar';
is_deeply $ar->get_content('foo.txt'), { name => 'foo.txt', date => 12345679, uid => 101, gid => 202, mode => 0100640, data => "foo content", size => 11 }, "foo content";
is_deeply $ar->get_content('bar.txt'), { name => 'bar.txt', date => 123456798, uid => 303, gid => 404, mode => 0100600, data => "bar content\nbar content\n", size => 24 }, "bar content";
};
}
( run in 1.697 second using v1.01-cache-2.11-cpan-39bf76dae61 )