summaryrefslogtreecommitdiff
path: root/t/ordep.t
diff options
context:
space:
mode:
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');