File: supplements.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 (54 lines) | stat: -rw-r--r-- 997 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/perl -w

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

require 't/testlib.pm';

my $repo = <<'EOR';
P: a = 1-1
P: a1 = 1-1
P: b = 1-1 p
s: a a1
P: c = 1-1 p
C: b
s: a1
P: d = 1-1
C: c
P: e = 1-1
P: x = 1-1
R: y
P: y1 = 1-1 y
P: y2 = 1-1 y
s: e
P: f = 1-1
s: (a and d)
P: n1 = 1-1
P: n2 = 1-1
s: (n1 unless (n3 if foo))
EOR

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

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

@r = expand($config, 'a1');
is_deeply(\@r, [undef, 'c conflicts with b'], 'install a1');

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

@r = expand($config, 'x');
is_deeply(\@r, [undef, 'have choice for y needed by x: y1 y2'], 'install x');

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

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

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