tests: archive info: code cleanup
We could also do a hash array slice, like:
> my ($archive, $expected, $description) = $tt->@{'archive', 'expected', 'description'};
But as none are optional lets just access values directly..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -119,16 +119,12 @@ foreach my $virt (keys %$non_bkp_suffix) {
|
|||||||
|
|
||||||
plan tests => scalar @$tests;
|
plan tests => scalar @$tests;
|
||||||
|
|
||||||
# run through tests array
|
for my $tt (@$tests) {
|
||||||
foreach my $tt (@$tests) {
|
|
||||||
my $description = $tt->{description};
|
my $got = eval { PVE::Storage::archive_info($tt->{archive}) };
|
||||||
my $archive = $tt->{archive};
|
|
||||||
my $expected = $tt->{expected};
|
|
||||||
my $got;
|
|
||||||
eval { $got = PVE::Storage::archive_info($archive) };
|
|
||||||
$got = $@ if $@;
|
$got = $@ if $@;
|
||||||
|
|
||||||
is_deeply($got, $expected, $description) || diag(explain($got));
|
is_deeply($got, $tt->{expected}, $tt->{description}) || diag(explain($got));
|
||||||
}
|
}
|
||||||
|
|
||||||
done_testing();
|
done_testing();
|
||||||
|
|||||||
Reference in New Issue
Block a user