5 use Test
::Simple tests
=> 3;
7 use Fedora
::Rebuild
::Solver
;
8 use Fedora
::Rebuild
::Set
::Package
;
9 use Fedora
::Rebuild
::Package
;
10 use Fedora
::Rebuild
::RPM
;
18 my $a = Fedora
::Rebuild
::Package
->new('name'=>'a', %common,
19 provides
=> { 'a' => [[Fedora
::Rebuild
::RPM
::ANY
, '']] }
21 my $b = Fedora
::Rebuild
::Package
->new('name'=>'b', %common,
22 provides
=> { 'b' => [[Fedora
::Rebuild
::RPM
::ANY
, '']] },
23 runrequires
=> { 'a' => [[Fedora
::Rebuild
::RPM
::ANY
, '']] }
25 my $c = Fedora
::Rebuild
::Package
->new('name'=>'c', %common,
26 provides
=> { 'c' => [[Fedora
::Rebuild
::RPM
::ANY
, '']] },
27 runrequires
=> { 'nonexistent' => [[Fedora
::Rebuild
::RPM
::ANY
, '']] }
30 my $packages = Fedora
::Rebuild
::Set
::Package
->new();
31 $packages->insert($a);
32 $packages->insert($b);
33 $packages->insert($c);
35 my $solver = Fedora
::Rebuild
::Solver
->new(packages
=> $packages);
37 ok
($solver->is_installable($a), 'a does not require nothing');
38 ok
($solver->is_installable($b), 'b requires a');
39 ok
(! $solver->is_installable($c), 'c requires nonexistent');