6 use Test
::Simple tests
=> 4 + 5;
8 use Fedora
::Rebuild
::RPM
;
10 # The ok() labels have format "REQUIRES ? COMMA_SEPARATED_PROVIDES".
11 # Non-flag-qualified cases
13 Fedora
::Rebuild
::RPM
::is_satisfied
(
14 'a', Fedora
::Rebuild
::RPM
::ANY
, '',
16 'a' => [ [Fedora
::Rebuild
::RPM
::ANY
, ''] ]
22 ! Fedora
::Rebuild
::RPM
::is_satisfied
(
23 'a', Fedora
::Rebuild
::RPM
::ANY
, '',
25 'b' => [ [Fedora
::Rebuild
::RPM
::ANY
, ''] ]
31 Fedora
::Rebuild
::RPM
::is_satisfied
(
32 'a', Fedora
::Rebuild
::RPM
::ANY
, '',
34 'b' => [ [Fedora
::Rebuild
::RPM
::ANY
, ''] ],
35 'a' => [ [Fedora
::Rebuild
::RPM
::ANY
, ''] ],
36 'c' => [ [Fedora
::Rebuild
::RPM
::ANY
, ''] ]
42 ! Fedora
::Rebuild
::RPM
::is_satisfied
(
43 'a', Fedora
::Rebuild
::RPM
::ANY
, '',
50 # Matrix cases. See module comments for the matrices. There should be 3*5*5
53 my ($order, $rflag, $pflag, $result) = @_;
55 my ($rversion, $pversion) = ('1', '1');
58 } elsif ($order > 0) {
63 $result == Fedora
::Rebuild
::RPM
::is_satisfied
(
64 'a', $rflag, $rversion,
66 'a' => [ [$pflag, $pversion] ]
69 'a ' . Fedora
::Rebuild
::RPM
::flag_as_string
($rflag) . " $rversion" .
70 ' ? a ' . Fedora
::Rebuild
::RPM
::flag_as_string
($pflag) .
75 matrix_test
(0, Fedora
::Rebuild
::RPM
::LESS
, Fedora
::Rebuild
::RPM
::LESS
, 1);
76 matrix_test
(0, Fedora
::Rebuild
::RPM
::LESS
,
77 Fedora
::Rebuild
::RPM
::LESS
|Fedora
::Rebuild
::RPM
::EQUAL
, 1);
78 matrix_test
(0, Fedora
::Rebuild
::RPM
::LESS
, Fedora
::Rebuild
::RPM
::EQUAL
, 0);
79 matrix_test
(0, Fedora
::Rebuild
::RPM
::LESS
,
80 Fedora
::Rebuild
::RPM
::GREATER
|Fedora
::Rebuild
::RPM
::EQUAL
, 0);
81 matrix_test
(0, Fedora
::Rebuild
::RPM
::LESS
, Fedora
::Rebuild
::RPM
::GREATER
, 0);