File: recommends.t

package info (click to toggle)
libbssolv-perl 0.17%2Bgit20250403%2Bfc787703f7f6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 396 kB
  • sloc: perl: 785; makefile: 12
file content (37 lines) | stat: -rw-r--r-- 734 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/perl -w

use strict;
use Test::More tests => 5;

require 't/testlib.pm';

my $repo = <<'EOR';
P: a = 1-1
r: b
P: a1 = 1-1
r: p
P: a2 = 1-1
r: (b or c)
P: a3 = 1-1
r: (b if c)
P: b = 1-1 p
P: c = 1-1 p
EOR

my $config = setuptest($repo, "Expandflags: dorecommends");
my @r;

@r = expand($config, 'a');
is_deeply(\@r, [1, 'a', 'b'], 'install a');

@r = expand($config, 'a1');
is_deeply(\@r, [undef, 'have choice for p needed by a1: b c'], 'install a1');

@r = expand($config, 'a2');
is_deeply(\@r, [undef, 'have choice for (b or c) needed by a2: b c'], 'install a2');

@r = expand($config, 'a3');
is_deeply(\@r, [1, 'a3'], 'install a3');

@r = expand($config, 'a3', 'c');
is_deeply(\@r, [1, 'a3', 'b', 'c'], 'install a3 c');