forked from openSUSE/obs-build
-
Notifications
You must be signed in to change notification settings - Fork 2
/
obsoletes.t
53 lines (40 loc) · 1.28 KB
/
obsoletes.t
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
#!/usr/bin/perl -w
use strict;
use Test::More tests => 9;
require 't/testlib.pm';
my $repo = <<'EOR';
P: a = 1-1
R: p
P: b = 1-1 p
P: c = 1-1 p
P: d = 1-1
O: b
P: e = 1-1
O: c
P: f = 1-1
O: p
P: g = 1-1
O: b c
P: h = 1-1
R: b d
EOR
my $config = setuptest($repo);
my @r;
@r = expand($config, 'a');
is_deeply(\@r, [undef, 'have choice for p needed by a: b c'], 'install a');
@r = expand($config, 'a', 'd');
is_deeply(\@r, [1, 'a', 'c', 'd'], 'install a d');
@r = expand($config, 'a', 'e');
is_deeply(\@r, [1, 'a', 'b', 'e'], 'install a e');
@r = expand($config, 'a', 'd', 'e');
is_deeply(\@r, [undef, '(provider b is obsoleted by d)', '(provider c is obsoleted by e)', 'conflict for providers of p needed by a'], 'install a d e');
@r = expand($config, 'a', 'f');
is_deeply(\@r, [undef, 'have choice for p needed by a: b c'], 'install a f');
@r = expand($config, 'b', 'd');
is_deeply(\@r, [undef, 'd obsoletes b'], 'install b d');
@r = expand($config, 'h');
is_deeply(\@r, [undef, 'd obsoletes b'], 'install h');
@r = expand($config, 'h', 'd');
is_deeply(\@r, [undef, '(provider b is obsoleted by d)', 'conflict for providers of b needed by h'], 'install h d');
@r = expand($config, 'h', 'b');
is_deeply(\@r, [undef, '(provider d obsoletes b)', 'conflict for providers of d needed by h'], 'install h b');