summaryrefslogtreecommitdiffstats
path: root/t/superuser--best-versioned-provide.t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-02-25 09:30:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-02-25 09:30:32 +0000
commita1b3f72f35afe3672b7f1fec1ba862120283f44a (patch)
tree052750c98e159d6222d8c16580b55b8121702903 /t/superuser--best-versioned-provide.t
parent85d0b5ca0090c0ebd5b8f957fb6cf53341f3b3bb (diff)
downloadurpmi-a1b3f72f35afe3672b7f1fec1ba862120283f44a.tar
urpmi-a1b3f72f35afe3672b7f1fec1ba862120283f44a.tar.gz
urpmi-a1b3f72f35afe3672b7f1fec1ba862120283f44a.tar.bz2
urpmi-a1b3f72f35afe3672b7f1fec1ba862120283f44a.tar.xz
urpmi-a1b3f72f35afe3672b7f1fec1ba862120283f44a.zip
add a test case for "sort choices on virtual package by provided version (#12645)"
Diffstat (limited to 't/superuser--best-versioned-provide.t')
-rw-r--r--t/superuser--best-versioned-provide.t39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/superuser--best-versioned-provide.t b/t/superuser--best-versioned-provide.t
new file mode 100644
index 00000000..a11a9df1
--- /dev/null
+++ b/t/superuser--best-versioned-provide.t
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+# a_cc requires cc
+# a_dd requires dd
+# a_ee requires ee
+#
+# b1 provides cc = 1, dd = 2, ee = 3
+# b2 provides cc = 2, dd = 3, ee = 1
+# b3 provides cc = 3, dd = 1, ee = 2
+#
+# so a_cc should require b3
+# a_dd should require b2
+# a_ee should require b1
+#
+# (cf mdvbz #12645)
+#
+use strict;
+use lib '.', 't';
+use helper;
+use Expect;
+use urpm::util;
+use Test::More 'no_plan';
+
+need_root_and_prepare();
+
+my $medium_name = 'best-versioned-provide';
+
+urpmi_addmedia("$medium_name $::pwd/media/$medium_name");
+
+test('a_cc', 'b3');
+test('a_dd', 'b2');
+test('a_ee', 'b1');
+
+sub test {
+ my ($to_install, $should_be_prefered) = @_;
+
+ urpmi("--auto $to_install");
+ check_installed_and_remove($to_install, $should_be_prefered);
+}