|
Packit |
82cce8 |
#!/usr/bin/perl
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
use strict;
|
|
Packit |
82cce8 |
use warnings;
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
use Test::More 'no_plan';
|
|
Packit |
82cce8 |
use lib qw(t t/data/static);
|
|
Packit |
82cce8 |
use Utils;
|
|
Packit |
82cce8 |
use version;
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
# Tests compilation of Module::ScanDeps
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
BEGIN { use_ok( 'Module::ScanDeps' ); }
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
# Static dependency check of a script that doesn't use
|
|
Packit |
82cce8 |
# anything with basic cache_cb test added
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
my @roots1 = qw(t/data/static/null.pl);
|
|
Packit |
82cce8 |
my $expected_rv1 =
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
"null.pl" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/null.pl"),
|
|
Packit |
82cce8 |
key => "null.pl",
|
|
Packit |
82cce8 |
type => "data",
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
};
|
|
Packit |
82cce8 |
expected_cache_cb_args({key => 'null.pl',
|
|
Packit |
82cce8 |
file => 't/data/static/null.pl',
|
|
Packit |
82cce8 |
});
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
my $rv1 = scan_deps(files => \@roots1,
|
|
Packit |
82cce8 |
cache_cb => \&cache_cb
|
|
Packit |
82cce8 |
);
|
|
Packit |
82cce8 |
compare_scandeps_rvs($rv1, $expected_rv1, \@roots1);
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
### check if we can use M::SD::Cache
|
|
Packit |
82cce8 |
my $skip_cache_tests = 1;
|
|
Packit |
82cce8 |
eval {require Module::ScanDeps::Cache;};
|
|
Packit |
82cce8 |
unless ($@){
|
|
Packit |
82cce8 |
$skip_cache_tests = Module::ScanDeps::Cache::prereq_missing();
|
|
Packit |
82cce8 |
warn $skip_cache_tests, "\n";
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
my $cache_file = 'deps_cache.dat';
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
for my $t(qw/write_cache use_cache/){
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
SKIP:
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
skip "Skipping M:SD::Cache tests" , 289 if $skip_cache_tests;
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
# Static dependency check of a circular dependency:
|
|
Packit |
82cce8 |
# ___
|
|
Packit |
82cce8 |
# |/_ \
|
|
Packit |
82cce8 |
# M _M
|
|
Packit |
82cce8 |
# \____/|
|
|
Packit |
82cce8 |
#
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
my @roots2 = qw(t/data/static/egg.pm);
|
|
Packit |
82cce8 |
my $expected_rv2 =
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
"chicken.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/chicken.pm"),
|
|
Packit |
82cce8 |
key => "chicken.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["egg.pm"],
|
|
Packit |
82cce8 |
uses => ["egg.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"egg.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/egg.pm"),
|
|
Packit |
82cce8 |
key => "egg.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["chicken.pm"],
|
|
Packit |
82cce8 |
uses => ["chicken.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
};
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
# Functional i/f
|
|
Packit |
82cce8 |
my $rv2 = scan_deps(files => \@roots2,
|
|
Packit |
82cce8 |
cache_file => $cache_file,
|
|
Packit |
82cce8 |
recurse => 1,
|
|
Packit |
82cce8 |
);
|
|
Packit |
82cce8 |
compare_scandeps_rvs($rv2, $expected_rv2, \@roots2);
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
# Static dependency check of the following dependency tree
|
|
Packit |
82cce8 |
#
|
|
Packit |
82cce8 |
# M
|
|
Packit |
82cce8 |
# /|\
|
|
Packit |
82cce8 |
# / | \
|
|
Packit |
82cce8 |
# / | \
|
|
Packit |
82cce8 |
# / M \
|
|
Packit |
82cce8 |
# / / \ \
|
|
Packit |
82cce8 |
# / / \ \
|
|
Packit |
82cce8 |
# M M M M
|
|
Packit |
82cce8 |
# \ \ / /
|
|
Packit |
82cce8 |
# \ \ / /
|
|
Packit |
82cce8 |
# \ M /
|
|
Packit |
82cce8 |
# \ | /
|
|
Packit |
82cce8 |
# \ | /
|
|
Packit |
82cce8 |
# M
|
|
Packit |
82cce8 |
#
|
|
Packit |
82cce8 |
# With dependencies always going from the top downwards
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
my @roots3 = qw(t/data/static/outer_diamond_N.pm);
|
|
Packit |
82cce8 |
my $expected_rv3 =
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
"inner_diamond_E.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/inner_diamond_E.pm"),
|
|
Packit |
82cce8 |
key => "inner_diamond_E.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["inner_diamond_N.pm"],
|
|
Packit |
82cce8 |
uses => ["inner_diamond_S.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"inner_diamond_N.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/inner_diamond_N.pm"),
|
|
Packit |
82cce8 |
key => "inner_diamond_N.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["outer_diamond_N.pm"],
|
|
Packit |
82cce8 |
uses => ["inner_diamond_E.pm", "inner_diamond_W.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"inner_diamond_S.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/inner_diamond_S.pm"),
|
|
Packit |
82cce8 |
key => "inner_diamond_S.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["inner_diamond_W.pm", "inner_diamond_E.pm"],
|
|
Packit |
82cce8 |
uses => ["outer_diamond_S.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"inner_diamond_W.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/inner_diamond_W.pm"),
|
|
Packit |
82cce8 |
key => "inner_diamond_W.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["inner_diamond_N.pm"],
|
|
Packit |
82cce8 |
uses => ["inner_diamond_S.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"outer_diamond_E.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/outer_diamond_E.pm"),
|
|
Packit |
82cce8 |
key => "outer_diamond_E.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["outer_diamond_N.pm"],
|
|
Packit |
82cce8 |
uses => ["outer_diamond_S.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"outer_diamond_N.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/outer_diamond_N.pm"),
|
|
Packit |
82cce8 |
key => "outer_diamond_N.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
uses => ["inner_diamond_N.pm", "outer_diamond_E.pm", "outer_diamond_W.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"outer_diamond_S.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/outer_diamond_S.pm"),
|
|
Packit |
82cce8 |
key => "outer_diamond_S.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["outer_diamond_E.pm", "outer_diamond_W.pm", "inner_diamond_S.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"outer_diamond_W.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/outer_diamond_W.pm"),
|
|
Packit |
82cce8 |
key => "outer_diamond_W.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["outer_diamond_N.pm"],
|
|
Packit |
82cce8 |
uses => ["outer_diamond_S.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
};
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
# Functional i/f
|
|
Packit |
82cce8 |
my $rv3 = scan_deps(cache_file => $cache_file,
|
|
Packit |
82cce8 |
recurse => 1,
|
|
Packit |
82cce8 |
files => \@roots3);
|
|
Packit |
82cce8 |
compare_scandeps_rvs($rv3, $expected_rv3, \@roots3);
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
# Static dependency check of the following dependency tree
|
|
Packit |
82cce8 |
# (i.e. multiple inputs)
|
|
Packit |
82cce8 |
#
|
|
Packit |
82cce8 |
# InputA.pl InputB.pl InputC.pl
|
|
Packit |
82cce8 |
# / \ \ /
|
|
Packit |
82cce8 |
# / \ \ /
|
|
Packit |
82cce8 |
# / \ \ /
|
|
Packit |
82cce8 |
# TestA.pm TestB.pm TestC.pm /
|
|
Packit |
82cce8 |
# \ /
|
|
Packit |
82cce8 |
# \ /
|
|
Packit |
82cce8 |
# TestD.pm
|
|
Packit |
82cce8 |
#
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
my @roots4 = qw(t/data/static/InputA.pl
|
|
Packit |
82cce8 |
t/data/static/InputB.pl
|
|
Packit |
82cce8 |
t/data/static/InputC.pl);
|
|
Packit |
82cce8 |
my $expected_rv4 =
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
"InputA.pl" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/InputA.pl"),
|
|
Packit |
82cce8 |
key => "InputA.pl",
|
|
Packit |
82cce8 |
type => "data",
|
|
Packit |
82cce8 |
uses => ["TestA.pm", "TestB.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"InputB.pl" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/InputB.pl"),
|
|
Packit |
82cce8 |
key => "InputB.pl",
|
|
Packit |
82cce8 |
type => "data",
|
|
Packit |
82cce8 |
uses => ["TestC.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"InputC.pl" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/InputC.pl"),
|
|
Packit |
82cce8 |
key => "InputC.pl",
|
|
Packit |
82cce8 |
type => "data",
|
|
Packit |
82cce8 |
uses => ["TestD.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"TestA.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/TestA.pm"),
|
|
Packit |
82cce8 |
key => "TestA.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["InputA.pl"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"TestB.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/TestB.pm"),
|
|
Packit |
82cce8 |
key => "TestB.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["InputA.pl"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"TestC.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/TestC.pm"),
|
|
Packit |
82cce8 |
key => "TestC.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["InputB.pl"],
|
|
Packit |
82cce8 |
uses => ["TestD.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"TestD.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/TestD.pm"),
|
|
Packit |
82cce8 |
key => "TestD.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["InputC.pl", "TestC.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
};
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
# Functional i/f
|
|
Packit |
82cce8 |
my $rv4 = scan_deps(cache_file => $cache_file,
|
|
Packit |
82cce8 |
recurse => 1,
|
|
Packit |
82cce8 |
files => \@roots4);
|
|
Packit |
82cce8 |
compare_scandeps_rvs($rv4, $expected_rv4, \@roots4);
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
# Static dependency check of the following dependency tree
|
|
Packit |
82cce8 |
# Tests the .pm only lists the .pl once in it's used_by entries
|
|
Packit |
82cce8 |
#
|
|
Packit |
82cce8 |
# Duplicator.pl
|
|
Packit |
82cce8 |
# / \
|
|
Packit |
82cce8 |
# / \
|
|
Packit |
82cce8 |
# / \
|
|
Packit |
82cce8 |
# \ /
|
|
Packit |
82cce8 |
# \ /
|
|
Packit |
82cce8 |
# \ /
|
|
Packit |
82cce8 |
# Duplicated.pm
|
|
Packit |
82cce8 |
#
|
|
Packit |
82cce8 |
##############################################################
|
|
Packit |
82cce8 |
my @roots5 = qw(t/data/static/Duplicator.pl);
|
|
Packit |
82cce8 |
my $expected_rv5 =
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
"Duplicated.pm" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/Duplicated.pm"),
|
|
Packit |
82cce8 |
key => "Duplicated.pm",
|
|
Packit |
82cce8 |
type => "module",
|
|
Packit |
82cce8 |
used_by => ["Duplicator.pl"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
"Duplicator.pl" => {
|
|
Packit |
82cce8 |
file => generic_abs_path("t/data/static/Duplicator.pl"),
|
|
Packit |
82cce8 |
key => "Duplicator.pl",
|
|
Packit |
82cce8 |
type => "data",
|
|
Packit |
82cce8 |
uses => ["Duplicated.pm"],
|
|
Packit |
82cce8 |
},
|
|
Packit |
82cce8 |
};
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
# Functional i/f
|
|
Packit |
82cce8 |
my $rv5 = scan_deps(cache_file => $cache_file,
|
|
Packit |
82cce8 |
recurse => 1,
|
|
Packit |
82cce8 |
files => \@roots5);
|
|
Packit |
82cce8 |
compare_scandeps_rvs($rv5, $expected_rv5, \@roots5);
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
} ### SKIP block wrapping M::SD::Cache tests
|
|
Packit |
82cce8 |
} ### end of for (qw/write_cache use_cache/)
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
### cache testing helper functions ###
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
my ($cb_args, $expecting_write);
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
sub expected_cache_cb_args{
|
|
Packit |
82cce8 |
$cb_args = shift;
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
sub cache_cb{
|
|
Packit |
82cce8 |
my %args = @_;
|
|
Packit |
82cce8 |
is($args{key}, $cb_args->{key}, "check arg 'key' in cache_cb.");
|
|
Packit |
82cce8 |
is($args{file}, $cb_args->{file}, "check arg 'file' in cache_cb.");
|
|
Packit |
82cce8 |
if ( $expecting_write ){
|
|
Packit |
82cce8 |
is($args{action}, 'write', "expecting write action");
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
if ($args{action} eq 'read'){
|
|
Packit |
82cce8 |
$expecting_write = 1;
|
|
Packit |
82cce8 |
return 0;
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
elsif ( $args{action} eq 'write' ){
|
|
Packit |
82cce8 |
$expecting_write = 0;
|
|
Packit |
82cce8 |
return 1
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
my $action = $args{action};
|
|
Packit |
82cce8 |
ok( 0, "wrong action: got [$action] must be 'read' or 'write'");
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
}### end cache testing helper functions ###
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
### test Module::ScanDeps::Cache.pm
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
SKIP:
|
|
Packit |
82cce8 |
{
|
|
Packit |
82cce8 |
skip "Skipping M:SD::Cache tests" , 9 if $skip_cache_tests;
|
|
Packit |
82cce8 |
my %files = ('file1.pl' => "use TestModule;\n",
|
|
Packit |
82cce8 |
'file2.pl' => "use TestModule;\n",
|
|
Packit |
82cce8 |
'file3.pl' => "use TestModule;\n return 0;\n");
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
for my $name (keys %files){
|
|
Packit |
82cce8 |
open my $fh, '>', $name or die "Can not open file $name: $!";
|
|
Packit |
82cce8 |
print $fh $files{$name};
|
|
Packit |
82cce8 |
close $fh or die "Can not close file $name: $!";
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
my $cb = Module::ScanDeps::Cache::get_cache_cb();
|
|
Packit |
82cce8 |
my $mod = [];
|
|
Packit |
82cce8 |
my $ret = $cb->(key => 'testfile',
|
|
Packit |
82cce8 |
file => 'file1.pl',
|
|
Packit |
82cce8 |
action => 'read',
|
|
Packit |
82cce8 |
modules => $mod
|
|
Packit |
82cce8 |
);
|
|
Packit |
82cce8 |
is( $ret, 0, "File not present in cache");
|
|
Packit |
82cce8 |
$ret = $cb->(key => 'testfile',
|
|
Packit |
82cce8 |
file => 'file1.pl',
|
|
Packit |
82cce8 |
modules => [qw /TestModule.pm/],
|
|
Packit |
82cce8 |
action => 'write',
|
|
Packit |
82cce8 |
);
|
|
Packit |
82cce8 |
is( $ret, 1, "Writing file to cache");
|
|
Packit |
82cce8 |
$ret = $cb->(key => 'testfile',
|
|
Packit |
82cce8 |
file => 'file1.pl',
|
|
Packit |
82cce8 |
action => 'read',
|
|
Packit |
82cce8 |
modules => $mod
|
|
Packit |
82cce8 |
);
|
|
Packit |
82cce8 |
is( $ret, 1, "File is present in cache");
|
|
Packit |
82cce8 |
is( $mod->[0], 'TestModule.pm', "cache_cb sets modules 1");
|
|
Packit |
82cce8 |
$mod = [];
|
|
Packit |
82cce8 |
$ret = $cb->(key => 'testfile',
|
|
Packit |
82cce8 |
file => 'file2.pl',
|
|
Packit |
82cce8 |
action => 'read',
|
|
Packit |
82cce8 |
modules => $mod
|
|
Packit |
82cce8 |
);
|
|
Packit |
82cce8 |
is( $ret, 1, "Identical file returns the same dependencies from cache");
|
|
Packit |
82cce8 |
is( $mod->[0], 'TestModule.pm', "cache_cb sets modules 2");
|
|
Packit |
82cce8 |
$mod = [];
|
|
Packit |
82cce8 |
$ret = $cb->(key => 'testfile',
|
|
Packit |
82cce8 |
file => 'file3.pl',
|
|
Packit |
82cce8 |
action => 'read',
|
|
Packit |
82cce8 |
modules => $mod
|
|
Packit |
82cce8 |
);
|
|
Packit |
82cce8 |
is( $ret, 0, "No cached deps returned for file with different content");
|
|
Packit |
82cce8 |
is( @$mod, 0, "cache_cb does not set modules if no deps found");
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
eval {$cb->(action => 'foo')};
|
|
Packit |
82cce8 |
ok ($@ =~ /must be read or write/, "cache_cb dies on wrong action");
|
|
Packit |
82cce8 |
for my $name (keys %files){
|
|
Packit |
82cce8 |
unlink $name or die "Could not unlink file $name: $!";
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
}
|
|
Packit |
82cce8 |
|
|
Packit |
82cce8 |
unlink( $cache_file );
|
|
Packit |
82cce8 |
__END__
|