#!perl
my
$t
= Pinto::Tester->new;
$t
->populate(
'AUTHOR/Foo-1 = Foo-1 & Bar~1'
);
$t
->populate(
'AUTHOR/Bar-1 = Bar-1 & Baz~1'
);
$t
->populate(
'AUTHOR/Baz-1 = Baz-1 & Foo~1'
);
subtest
'handle circular prerequisites'
=>
sub
{
my
$cb
=
sub
{
my
(
$prereq
) =
@_
;
my
$dist
=
$t
->pinto->repo->get_distribution(
target
=>
$prereq
->as_target );
ok
defined
$dist
,
"Got distribution for prereq $prereq"
;
return
$dist
;
};
my
$dist
=
$t
->get_distribution(
author
=>
'AUTHOR'
,
archive
=>
'Foo-1.tar.gz'
);
my
$walker
= Pinto::PrerequisiteWalker->new(
start
=>
$dist
,
callback
=>
$cb
);
while
(
$walker
->
next
) { }
ok 1,
'Escaped circular dependencies'
;
};
done_testing;