App-karr
view release on metacpan or search on metacpan
t/216-ex-sandbox.t view on Meta::CPAN
}
# Recursive size+mtime signature of a file or directory, used only to prove
# the real ex/ sandbox is byte-for-byte unchanged before vs. after this test
# runs. 'MISSING' is a valid, comparable signature (the maintainer's ex/ may
# or may not have been built yet).
sub _fs_signature {
my ($target) = @_;
return 'MISSING' unless -e $target;
my $p = path($target);
return 'FILE ' . join( ' ', ( stat("$p") )[ 7, 9 ] ) if $p->is_file;
my @entries;
$p->visit(
sub {
my ( $child, undef ) = @_;
return if $child->is_dir;
push @entries, $child->relative($p) . ' ' . join( ' ', ( stat("$child") )[ 7, 9 ] );
},
{ recurse => 1 }
);
return join( "\n", sort @entries );
}
sub _list_json {
my ( $sandbox, $repo ) = @_;
my $res = _karr( $sandbox, '--dir', "$sandbox/ex/$repo", 'list', '--json' );
is( $res->{exit}, 0, "karr --dir ex/$repo list --json exits 0" ) or diag $res->{stderr};
( run in 1.207 second using v1.01-cache-2.11-cpan-7a24b6fcba5 )