blob: d7343bc5ed77e7e118beee91ac79d9cb1925b11b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/usr/bin/perl
use 5.028;
use strict;
use warnings;
use lib 't/lib';
use Test::More;
use Git::Annex;
use File::Spec::Functions qw(catfile);
use t::Setup;
use Storable;
use Data::Compare;
with_temp_annexes {
my $temp = shift;
my $annex = Git::Annex->new("source1");
my $unused_info = catfile($temp, qw(source1 .git annex unused_info));
ok $annex->_git_path("blah", "foo")
eq catfile($temp, qw(source1 .git blah foo)),
"_git_path resolves a path";
ok $annex->_unused_cache eq $unused_info,
"_unused_cache resolves to correct path";
$annex->{_unused} = { foo => "bar" };
$annex->_store_unused_cache;
ok Compare($annex->{_unused}, retrieve $unused_info),
"_store_unused_cache stores the cache";
$annex->_clear_unused_cache;
ok !exists $annex->{_unused}, "_clear_unused_cache clears unused hashref";
ok !-f $unused_info, "_clear_unused_cache deletes the cache";
};
done_testing;
|