summaryrefslogtreecommitdiff
path: root/t/ordep.t
diff options
context:
space:
mode:
authorHéctor Orón Martínez <zumbi@debian.org>2019-09-01 01:59:08 +0200
committerHéctor Orón Martínez <zumbi@debian.org>2019-09-01 01:59:08 +0200
commitaa4eb19801ac75c21ce2493bd541e8abb3110a2d (patch)
tree6ef1b955612d9620f9a78eb1790f11e5269a9818 /t/ordep.t
parentef4d8af41e3a65486c49899f501135d4b7f39932 (diff)
parent93b7b773f7b8490c80d729af435b973bcdd484ad (diff)
Record obs-build (20180831-3) in archive suite sid
Diffstat (limited to 't/ordep.t')
-rw-r--r--t/ordep.t35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/ordep.t b/t/ordep.t
new file mode 100644
index 0000000..09f4f29
--- /dev/null
+++ b/t/ordep.t
@@ -0,0 +1,35 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 4;
+
+require 't/testlib.pm';
+
+my $repo = <<'EOR';
+P: a = 1-1
+R: x | y
+P: b = 1-1
+R: d | e
+P: c = 1-1
+R: d | f
+P: d = 1-1
+P: e = 1-1
+P: f = 1-1
+P: g = 1-1
+R: x | e | d
+EOR
+
+my $config = setuptest($repo, "Binarytype: deb\nPrefer: f\n");
+my @r;
+
+@r = expand($config, 'a');
+is_deeply(\@r, [undef, 'nothing provides x | y needed by a'], 'install a');
+
+@r = expand($config, 'b');
+is_deeply(\@r, [1, 'b', 'd'], 'install b');
+
+@r = expand($config, 'c');
+is_deeply(\@r, [1, 'c', 'f'], 'install c');
+
+@r = expand($config, 'g');
+is_deeply(\@r, [1, 'e', 'g'], 'install g');