File: supplements.t

package info (click to toggle)
libbssolv-perl 0.15-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 368 kB
  • sloc: perl: 545; makefile: 14
file content (42 lines) | stat: -rw-r--r-- 762 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -w

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

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
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');